Git more advance¶
Playing with multiples git remotes and repositories¶
- Using multiples git remotes and pushing to multiple git repositories :
git remote set-url --add --push [remote] [original repo URL] git remote set-url --add --push [remote] [second repo URL] git remote -v
more Git more advance commands¶
- Adding a All alias for multiples repositories :
git remote add all REMOTE-URL-1 : Define a git remote which will point to multiple git remotes git remote set-url --add --push all REMOTE-URL-1 git remote set-url --add --push all REMOTE-URL-2 git push all BRANCH git fetch --all : You cannot pull from multiple remotes, but you can fetch updates from multiple remotes
- Adding multiple remotes :
git remote add REMOTE-ID REMOTE-URL git remote add origin GitHub_remote_1 git remote add upstream GitHub_remote_2
more exemple on the official documentation : https://git-scm.com/docs/git-remote