git set upstream shortcut

This commit is contained in:
Noah Masur
2020-11-22 23:33:00 -05:00
parent e64832cdf5
commit c25c996061
2 changed files with 13 additions and 0 deletions

12
bin/git_set_upstream Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# Copied from David Pedersen: https://github.com/davidpdrsn/dotfiles/blob/master/bin/git-pp
set -e
function git_branch_name {
val=`git branch 2>/dev/null | grep '^*' | colrm 1 2`
echo "$val"
}
git push --set-upstream origin $(git_branch_name)