Skip to content

Two Remote Git Repositories (or more)

Add both repositories:

Note

Only one remote repo can be named origin

git remote add origin git@git.siteOne.com:username/firstRemoteRepo.git

git remote add gitea git@ssh.siteTwo.io:username/secondRemoteRepo.git

Info

The second repository's name can be anything, in this case it's gitea

Then:

git remote set-url --add --push origin git@git.siteOne.com:username/firstRemoteRepo.git

git remote set-url --add --push origin git@ssh.siteTwo.io:username/secondRemoteRepo.git

Info

The names of the remote repositories don't have to be the same


Last update: September 24, 2023