3 ms·
How I usually do it if I want to have my project on Github and Gitlab is configure two push remotes like this: > git remote set-url --add --push origin <github
by fileeditview 6y ago
How I usually do it if I want to have my project on Github and Gitlab is configure two push remotes like this:
> git remote set-url --add --push origin <github-remote>
> git remote set-url --add --push origin <gitlab-remote>
This way I have an automatic backup to the second remote.
- mcintyre1994 6y agoDoes this mean when you `git push origin <branch>` it gets pushed to both remotes? I had no idea you could have two remotes with the same name, neat!
- giancarlostoro 6y agoTIL that's exactly what this does, alternatively you can add them all to an 'all' remote, to make it more explicit: https://jigarius.com/blog/multiple-git-remote-repositories#two-minute-version https://jigarius.com/blog/multiple-git-remote-repositories#t... However, you can add multiple URLs to 'origin' and push to them all at once.