offline-gists is a simple Ruby Rakefile that makes it easy to keep offline copies (i.e. backups) of gists.
- Paranoia -- what happens if github loses my critical gists?
- Offline access -- not all airplanes have wifi
- Ruby 1.9.2
- Rubygems
bundler
gemgit
gempsych
gem
Google will help you get Ruby and Rubygems installed if you don't have
them already. (You can check with these commands: ruby -v
and
gem -v
.) Then:
- Run
bundle
- Clone this repository (
git clone git://github.com/masnick/offline-gists.git
) - Rename
gists/manifest_example.yaml
togists/manifest.yaml
and add your gists. - From the root folder of the repository, run
rake
. You should see your gists cloned into thegists/
subfolder.
The format is simple YAML:
---
'local name for gist': 478d9e3cd926028c91f6
'local name for another gist': 901651
You can have as many gists as you want in here.
The name for each gist is just used for naming the folder of the local repository. Spaces are converted into dashes and all non-alphanumeric characters are removed.
You can have as many folders as you want at the same level as gists/
.
Each of these can have a manifest.yaml
file. The rake task defaults to
the gists/
folder, but you can run rake run[foo]
to use the manifest file
in the foo/
folder.
This is easy! Just make your gists/
or other folder a git repository.
cd gists
git init
Then add the following to gists/.gitignore
:
*
!.gitignore
!manifest.yaml
Then make your initial commit:
git add -A
git ci -am "initial commit"
Now you can push/pull this repository as you would normally. Note: if you share this repository publicly and it includes private gists, these gists will be accessible to anyone who looks at the manifest file!
All rights reserved. Feel free to use for non-commercial or personal projects. For other uses, please contact me via my website.