]> git.phdru.name Git - git-scripts.git/commitdiff
Feat(update-remotes): Force-push branches to `web`
authorOleg Broytman <phd@phdru.name>
Sun, 17 Dec 2023 12:45:21 +0000 (15:45 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 17 Dec 2023 12:45:21 +0000 (15:45 +0300)
Always force-push `master` and additional branches to `web`.

update-remotes

index 4c59b31f8512c2612eb2ec074f0b246d3f3510b9..75f7f53568d3a757144844690a350e68f330ff15 100755 (executable)
@@ -2,6 +2,7 @@
 
 current="`git config --get --path remote.current.url`"
 origin="`git config --get --path remote.origin.url`"
+branches="master ${1:+$@}"
 
 if [ -n "$origin" ]; then
    if [ -n "$current" ]; then
@@ -21,7 +22,7 @@ git fetch current &&
 
 web="`git config --get --path remote.web.url`" &&
 if [ -n "$web" ]; then
-   git push web "$@"
+   git push --force web $branches
 fi &&
 
 cd "$current" && exec git pull origin