I have a server that I'm taking down. The only thing I have left to migrate is my repository. This server is listed as the origin (master) for one of my projects. What is the proper way to move the repository to keep the history.
+8
A:
Copy it over. It's really that simple. :)
On the client side, just edit .git/config in the client's local repo to point your remotes to the new URL as necessary.
bdonlan
2009-09-27 22:28:51
+1. I'd rsync it over, personally.
Don Branson
2009-09-27 22:40:41
You can also simply clone it. Also, instead of directly editing the .git/config file, you can use git remote rm origin; git remote add origin <new repository>.
ebneter
2009-09-28 06:21:55
rming the remote will lose any configuration under that section of the config - and cloning it without taking any extra steps will lose branches other than trunk. It's possible to deal with these problems, but, really - just rsync it.
bdonlan
2009-09-28 14:13:42
+3
A:
To add the new repo location,
git remote add new_repo_name new_repo_url
Then push the content to the new location
git push new_repo_name master
Finally remove the old one
git remote rm origin
After that you can do what bdonlan said and edit the.git/config file to change the new_repo_name to origin. If you don't remove the origin (original remote repository), you can simply just push changes to the new repo with
git push new_repo_name master
Koby
2009-09-27 22:37:29