Moving GIT repos to another server, have local copy, how to do this?
Say I have a GIT repos that I conne开发者_运维技巧ct to from my laptop, I have the latest code locally now.
Is it possible for me to setup GIT on another server, and then make this my new 'remote master' and init the repo with what I have locally on my laptop? (say my server crashed with no backup)
You have two options:
Either you set up a new remote and from now on push to/pull from there using:
git remote add new-remote <new-url>
Or you can change the url of your current default remote (called origin
):
git remote set-url origin <new-url>
精彩评论