all repos — dotfiles @ 9d4daac1b851d9a89b0a429277c3d4d64331812d

my *nix dotfiles

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

 1#!/bin/sh
 2# git new-push-remote: adds a new push-only remote to a repository
 3# without removing the existing push remote.
 4
 5[[ "$@" == "" ]] && {
 6    printf '%s\n' "usage: git new-push-remote <remote url>"
 7    exit
 8}
 9
10old_push_remote="$(git remote -v | grep '(push)' | awk '{print $2}')"
11git remote set-url "$(git remote show)" --add --push "$1"
12git remote set-url "$(git remote show)" --add --push "$old_push_remote"