Skip to content

Instantly share code, notes, and snippets.

@filippo
Created April 9, 2020 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filippo/4bd40e12826891006fe885aa0623df81 to your computer and use it in GitHub Desktop.
Save filippo/4bd40e12826891006fe885aa0623df81 to your computer and use it in GitHub Desktop.
GIT-multiple-remote-repositoies

GIT working with remote repositories

To see all the remote repositories: git remote -v

To add a remote (eg. named tokyo): git remote add tokyo git@remote_server:path-toproject/project.git

To remove a remote : git remote rm tokyo

To see details on a remote:

git remote show tokyo
git remote show origin

GIT push to remotes

The base push command is: git push {remote} {branch}

We usually do: git push origin master or simply git push if the origin is tracked. To push to a different repository than the one that is tracked (eg. tokyo) we do:

git push tokyo master
git push tokyo develop
git push tokyo feature-branch
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment