Skip to content

Instantly share code, notes, and snippets.

@neofob
Created November 16, 2015 03:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save neofob/475268275cbf242f3743 to your computer and use it in GitHub Desktop.
moving from one git repo to another one
git remote add other /path/to/XXX
git fetch other
git checkout -b ZZZ other/master
mkdir ZZZ
git mv stuff ZZZ/stuff             # as necessary
git commit -m "Moved stuff to ZZZ"
git checkout master                
git merge ZZZ                      # should add ZZZ/ to master
git commit
git remote rm other
git branch -d ZZZ                  # to get rid of the extra branch before pushing
git push                           # if you have a remote, that is

Reference: http://stackoverflow.com/questions/1683531/how-to-import-existing-git-repository-into-another

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment