Create a gist now

Instantly share code, notes, and snippets.

@neofob /git.md
Created Nov 16, 2015

What would you like to do?
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