Skip to content

Multiple remote git configuration for repositoryΒΆ

Sometimes there could be need to maintain the code in multiple repositories. If you are looking for that please proceed.

The repository can have multiple remote git repositories - Github - Gitlab

SetupΒΆ

  • Create or clone repository from Github
  • Open the repository with SourceTree
  • Create new repository and init in Gitlab
  • Add remote repository url of newly crated repository

Note: Make sure Gitlab might have default branch as master and might be protected. Once the code is pushed change main as default branch and delete master.

Update codeΒΆ

  • Update code, commit and push. This will push to default repo gitlab
  • To update secondary repository or github in this case, push to github origin
  • If you are using secondary machine, you will have to follow the same procedure