Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save coffeesam/7687950 to your computer and use it in GitHub Desktop.
Save coffeesam/7687950 to your computer and use it in GitHub Desktop.

Archive a GitHub Repository

git clone --bare git@github.com:jonlong/<repo>.git
tar -czf <repo>.git.tar.gz <repo>.git

Deploy an Archived Repository to GitHub

Create a new private repository on the target account:

curl -F 'login=<user>' -F 'token=<token>' -F 'name=jonlong/<repo>' -F 'public=0' http://github.com/api/v2/json/repos/create

Extract the archived repository:

tar -xvzf <repo>.tar.gz

Navigate to the bare repository:

cd <repo>.git

Push the repository to GitHub

git push --mirror git@github.com:jonlong/<repo>.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment