Git: Dealing with Multiple Remote URLs
1 min readMay 5, 2022
--
Adding multiple remote URLs to your codebase:
Here is the step-by-step guide, very well written!
Pull and push from multiple remote URLs:
- To pull all branches from multiple remotes:
git pull --all
- To pull specific branch from multiple remotes:
git pull --all <branch>
- To push all branches to multiple remotes:
git remote | xargs -L1 git push --all
- To push specific branch to multiple remotes:
git remote | xargs -L1 -I R git push R <branch>
For more info on git push commands, checkout the answer at the stack overflow.
Delete URL
git remote remove <url_name>
Rename URL
git remote rename <url_oldname> <url_newname>