I have a server that is hosting my 'bare' GIT repo for a few projects.
I want to know what it takes to move the GIT to another server?
I have a server that is hosting my 'bare' GIT repo for a few projects.
I want to know what it takes to move the GIT to another server?
Doesn't this work?
Just copy the parent directory to the new machine and have the checked out copies update their remote with git remote set-url <remotename> <url>
. Once you've verified that the users can push/pull properly with the new remote you can delete the copy from the old machine.
Git repositories are location-agnostic as to their host file system, and Git itself does not depend on a persistent server process – so on the server side, all you need to do is just copy the foo.git
directory to somewhere on your new server.
And all remotes are equal in Git. So you can just add the new URL as another remote if you want to. Or else you can just open the .git/config
file and edit the URL of your existing remote to change it. (If it doesn’t work, you can change it back in the same way.)
Git is very non-magic.