glb backs up Github repositories to your local filesystem.
glb can be installed via npm:
[sudo] npm install [-g] github-local-backup
After installing, a glb executable will reside on your PATH.
glb requires that git be installed on your system PATH. In order to
minimize configuration, glb works by simply defering to git on the shell.
glb accepts a list of newline-delimited URLs on stdin and downloads the
specified repositories to <target-dir>.
# repos.txt contains a list of repository URLs
user@host:~$ cat ~/desktop/repos.txt
git@github.com:john-doe/alpha.git
git@github.com:john-doe/bravo.git
git@github.com:jane-doe/charlie.git
# pipe repos.txt into stdin
user@host:~$ cat ~/desktop/repos.txt | glb download ~/src/github-backupRepositories will be grouped by username to prevent namespace conflicts:
user@host:~$ tree ~/src/github-backup
github-backup
├── john-doe
│ ├── alpha
│ ├── bravo
└── jane-doe
└── charlieRepositories that are absent from <target-dir> will be downloaded locally via
git clone. Repositories that are present in <target-dir> will be updated
via git pull --all.
If provided with a Github Personal API token, glb can generate a
list of all repositories to which a given account has access:
user@host:~$ glb discover $TOKEN
git@github.com:john-doe/alpha.git
git@github.com:john-doe/bravo.git
git@github.com:jane-doe/charlie.gitglb discover and glb download may be chained to back up all of your Github
repositories:
user@host:~$ glb discover $TOKEN | glb download ~/src/github-backup