Skip to content

Instantly share code, notes, and snippets.

@wellic
Created February 16, 2015 11:55
Show Gist options
  • Save wellic/09128c98b7688b3cdd20 to your computer and use it in GitHub Desktop.
Save wellic/09128c98b7688b3cdd20 to your computer and use it in GitHub Desktop.
Git push for 2 servers
# rename origin remote
git remote rename origin server1name
# add the gitlab remote (for the love of everything that’s holy, use ssh)
git remote add server2name <remote link for server2>
# push existing code to new remote
git push -u server2name —all
# let’s magic
git config -e
# add this in the file
[remote “origin”]
url = <remote link for server1>
url = <remote link for server2>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment