Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hlandry
Created December 27, 2011 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlandry/1524244 to your computer and use it in GitHub Desktop.
Save hlandry/1524244 to your computer and use it in GitHub Desktop.
Archive a repo and re-import it later.
# Warning, this was only tested on small project that use only the main branch. use at your own risk...
# First clone your repo
$ git clone <some repo>
$ cd <some repo>
$ git remote -v
origin olduser@oldhost.com:OldRepoName.git (fetch)
origin olduser@oldhost.com:OldRepoName.git (push)
$ git remote rm origin
# Then archive.
# Some time later, when restarting to work on the project, create a blank repo in git hub and do :
$ git remote add origin git@github.com:YourUserName/NewRepoName.git
$ git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment