Skip to content

Instantly share code, notes, and snippets.

@cebe
Forked from geelen/Article.md
Created August 17, 2011 11:01
Show Gist options
  • Save cebe/1151325 to your computer and use it in GitHub Desktop.
Save cebe/1151325 to your computer and use it in GitHub Desktop.

Idiot-Proof Git Aliases

function git_current_branch() {
git symbolic-ref HEAD 2> /dev/null | sed -e 's/refs\/heads\///'
}
alias gpthis='git push origin HEAD:$(git_current_branch)'
alias grb='git rebase -p'
alias gup='git fetch origin && grb origin/$(git_current_branch)'
alias gm='git merge --no-ff'
function git_parse_branch
sh -c 'git symbolic-ref HEAD 2> /dev/null' | sed -e 's/refs\/heads\///'
end
function gm
git merge --no-ff $argv;
end
function gpthis
git push origin HEAD:(git_parse_branch) $argv
end
function gup
git fetch origin; and git rebase -p origin/(git_parse_branch) $argv;
end
@cebe
Copy link
Author

cebe commented Aug 17, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment