dotfiles/bin/git_set_upstream

13 lines
260 B
Plaintext
Raw Normal View History

2021-04-22 13:46:59 +00:00
#!/bin/sh
2020-11-23 04:33:00 +00:00
# Copied from David Pedersen: https://github.com/davidpdrsn/dotfiles/blob/master/bin/git-pp
set -e
2021-04-22 13:46:59 +00:00
git_branch_name() {
val=$( git branch 2>/dev/null | grep '^\*' | colrm 1 2 )
2020-11-23 04:33:00 +00:00
echo "$val"
}
2021-04-22 13:46:59 +00:00
git push --set-upstream origin "$(git_branch_name)"