gpp execute after cli

This commit is contained in:
Noah Masur 2021-10-21 11:21:31 -04:00
parent b9e248be32
commit a1962afef0
3 changed files with 7 additions and 13 deletions

View File

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

View File

@ -30,7 +30,7 @@ function abbrs --description 'All abbreviations'
abbr -a gca 'git commit --amend' abbr -a gca 'git commit --amend'
abbr -a gu 'git pull' abbr -a gu 'git pull'
abbr -a gp 'git push' abbr -a gp 'git push'
abbr -a gpp 'git_set_upstream' abbr -a gpp 'git-push-upstream'
abbr -a gl 'git log --graph --decorate --oneline -20' abbr -a gl 'git log --graph --decorate --oneline -20'
abbr -a gll 'git log --graph --decorate --oneline' abbr -a gll 'git log --graph --decorate --oneline'
abbr -a gco 'git checkout' abbr -a gco 'git checkout'

View File

@ -0,0 +1,6 @@
function git-push-upstream --description "Create upstream branch"
set -l branch (git branch 2>/dev/null | grep '^\*' | colrm 1 2)
set -l command "git push --set-upstream origin $branch"
commandline -r $command
commandline -f execute
end