diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-11-29 10:19:34 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-11-30 14:20:59 -0700 |
commit | 6cad9b963cc0bfd7fd0d9d358db4b87db3eb02f3 (patch) | |
tree | f6dad2f9a31f14a0ce1552340da6283d783ea849 /bin/git-push-all | |
parent | 98ea65db814f26e2e16002f2a00fd308711ec6fb (diff) | |
download | dotfiles-6cad9b963cc0bfd7fd0d9d358db4b87db3eb02f3.tar.gz |
git-push-all: force push to explicitly configured push remotes
Diffstat (limited to 'bin/git-push-all')
-rwxr-xr-x | bin/git-push-all | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/git-push-all b/bin/git-push-all index 7c6cddfb..b1c0d072 100755 --- a/bin/git-push-all +++ b/bin/git-push-all @@ -20,7 +20,7 @@ # This script will try to push all your branches to the places they # should be pushed, with --follow-tags. Specifically, for each branch, # -# 1. If branch.pushRemote is set, push it there +# 1. If branch.pushRemote is set, force push it there # # 2. Otherwise, if remote.pushDefault is set and a branch of the same name # already exists on that remote, push it there @@ -71,9 +71,9 @@ foreach my $branch (@local_branches) { # push unless the branch already exists on the remote: this script # avoids creating new branches if ($pushRemote) { - say "I: would push $short_branch to $pushRemote (its pushRemote)" + say "I: would force push $short_branch to $pushRemote (its pushRemote)" if $dry_run; - push $pushes{$pushRemote}->@*, $branch; + push $pushes{$pushRemote}->@*, "+$branch"; } elsif ($pushDefault and exists $remote_branches{"refs/remotes/$pushDefault/$short_branch"}) { @@ -88,7 +88,8 @@ foreach my $branch (@local_branches) { push $pushes{$tracking_remote}->@*, $branch; } elsif (!$need_pull_tracking) { say "W: couldn't find anywhere to push $branch"; - say "I: maybe you want to \`git branchmove\` it to a remote\n"; + say "I: perhaps \`git branchmove\` it somewhere, " + . "or set its pushRemote for -f pushes\n"; } } |