Last active
June 11, 2026 08:00
-
-
Save AntumDeluge/5f4688622c89286567dbbd627c5d8ba2 to your computer and use it in GitHub Desktop.
Git aliases for managing multipe mirrors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| # use custom alias instead of `git remote` to exclude possible third party forks | |
| myremotes = !echo # add remote names here | |
| fetchmaster = "!f() { echo \"Fetching branch master ...\"; for r in `git myremotes`; do git fetch ${r} refs/heads/master; done; }; f" | |
| pushmaster = "!f() { echo \"Pushing branch master ...\"; for r in `git myremotes`; do git push ${r} master:master; done; }; f" | |
| pushbranch = "!f() { b=`git branch --show-current` && echo \"Pushing branch ${b} ...\"; for r in `git myremotes`; do git push ${r} refs/heads/${b}; done; }; f" | |
| pushfbranch = "!f() { b=`git branch --show-current` && echo \"Force pushing branch ${b} ...\"; for r in `git myremotes`; do git push -f ${r} refs/heads/${b}; done; }; f" | |
| pushtags = "!f() { echo \"Pushing tags ...\"; for r in `git myremotes`; do git push --tags ${r}; done; }; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment