Skip to content

Instantly share code, notes, and snippets.

@tansengming
Created August 28, 2012 02:47
Show Gist options
  • Save tansengming/3494480 to your computer and use it in GitHub Desktop.
Save tansengming/3494480 to your computer and use it in GitHub Desktop.
gup.fish
function gup
if git diff-index --quiet HEAD
gup_base
else
echo 'your index is dirty'
echo 'please git stash or commit, then rerun gup'
end
end
function gup_base
git fetch origin; and git rebase -p origin/(git_current_branch)
end
function git_current_branch
git symbolic-ref HEAD 2> /dev/null | sed -e 's/refs\/heads\///'
end
function sgup
gup; and git push origin (git_current_branch)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment