all repos — dotfiles @ f6f35e0c85c911eb7c82d88153253a1f13499334

my *nix dotfiles

home/bin/git-new-push-remote (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
#!/bin/sh
# git new-push-remote: adds a new push-only remote to a repository
# without removing the existing push remote.

[[ "$@" == "" ]] && {
    printf '%s\n' "usage: git new-push-remote <remote url>"
    exit
}

old_push_remote="$(git remote -v | grep '(push)' | awk '{print $2}')"
git remote set-url "$(git remote show)" --add --push "$1"
git remote set-url "$(git remote show)" --add --push "$old_push_remote"