#!/bin/sh # you can pass in git parameters to this script too # e.g # git-pushall git --git-dir=$HOME/.dotfiles --work-tree=$HOME cmd="$@" [ -z "$cmd" ] && cmd="git" config_path="$($cmd config --local -l)" 2>/dev/null [ ! "$?" = 0 ] && echo "Failed: not a git repo." && exit 1 echo "$config_path" | grep '^remote.*.url=' |\ sed 's/^remote.*.url=//' |\ xargs printf "$cmd push %s master\n" |\