Created
August 28, 2012 02:47
-
-
Save tansengming/3494480 to your computer and use it in GitHub Desktop.
gup.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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