How to fully migrate a git repo with with history?
How to fully migrate a git repo with with history?
How do i copy all branches with a full commit history, manually copying the files into the new repository location will obviously not work
You might want to post your answer as an answer to the above question, rather than opening a new question.
– Tim Biegeleisen
Aug 28 at 9:11
Possible duplicate of How to duplicate a git repository? (without forking)
– phd
Aug 28 at 15:23
1 Answer
1
Clone your current remote branch
git clone --bare git_repo_address
git clone --bare git_repo_address
--bare - Clone all branches (When a repo is cloned for the first time it will only pull the master branch)
--bare
Set the new remote location to the current copy
git remote set-url origin new_remote_location
git remote set-url origin new_remote_location
Note: Make sure you are in the directory you cloned your repo into
Push all branches to the new origin
git push -u origin --all
git push -u origin --all
-u - set upstream
-u
--all - push all references
--all
Not sure who up-voted this, but the description of
bare, and of the default cloning behavior, is factually wrong.– Mark Adelsberger
Aug 28 at 12:53
bare
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Possible duplicate: stackoverflow.com/questions/6613166/…
– Tim Biegeleisen
Aug 28 at 9:11