The script attempts to be agnostic to both git version and gitconfig
settings.
To mimic the script in a git alias, run the following command:
git config -g alias.mkbranch '!foo() { git fetch origin && git checkout -b "$1" "${2:-origin/master}" && git push -u origin "$1":"$1"; }; foo'
Alternatively, copy or create a symlink from this script to somewhere in
your $PATH
and give it the name git-mkbranc
for the same effect:
ln -s /path/to/script/git-mkbranch.sh ~/bin/git-mkbranch