From df12199fdb46093db93c9f8d70875627e35530e3 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 18 Sep 2020 17:12:21 +0200 Subject: [PATCH] git: Add git pushall alias `git pushall` (aliased to gpa) will push the current branch to each connected remote of the repository. So, if you have gitlab, github and keybase connected as remotes, it will push to each one in return. As with the normal push command, you can specify which branch to push ('master', 'develop', ..) after the command, or use `--all` to push all branches at once. --- git/.config/git/config | 2 ++ git/.config/sh/alias.d/git.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/git/.config/git/config b/git/.config/git/config index 90f728f..5dd127a 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -11,6 +11,8 @@ ignore = "!gitignore -f" pushmerge = "push -o merge_request.merge_when_pipeline_succeeds" # see https://docs.gitlab.com/ce/user/project/push_options.html#merge-when-pipeline-succeeds-alias last = "diff HEAD~ HEAD" + # push to all connected remotes + pushall = "!git remote | xargs -L1 -I R git push R" [commit] # sign commits as me gpgsign = true diff --git a/git/.config/sh/alias.d/git.sh b/git/.config/sh/alias.d/git.sh index 6d766c8..2b86007 100644 --- a/git/.config/sh/alias.d/git.sh +++ b/git/.config/sh/alias.d/git.sh @@ -45,6 +45,7 @@ alias gpn='git push --dry-run' alias gp='git push' alias gpf!='git push --force' alias gpm='git pushmerge' +alias gpa='git pushall' alias grv='git remote -v'