Skip to content

Instantly share code, notes, and snippets.

@joeshaw
Last active September 13, 2016 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeshaw/1efa84954539eb72d66f7520a4ca9569 to your computer and use it in GitHub Desktop.
Save joeshaw/1efa84954539eb72d66f7520a4ca9569 to your computer and use it in GitHub Desktop.
partial .gitconfig
[alias]
find = !sh -c 'git ls-files |grep --color=auto -i "$@" |less -FRSX' -
fixup = "!f() { TARGET=$(git rev-parse "$1"); git commit --fixup=$TARGET ${@:2} && EDITOR=true git rebase -i --autostash --autosquash $TARGET^; }; f"
squash = "!f() { TARGET=$(git rev-parse "$1"); git commit --squash=$TARGET ${@:2} && git rebase -i --autostash --autosquash $TARGET^; }; f"
ri = rebase --interactive --autosquash --autostash
lt = log --graph --pretty=changes
ll = log --numstat --pretty=changes
ds = diff --staged
ego = shortlog -s -n --no-merges
pr = pull-request
rbs = !git for-each-ref --sort=committerdate --format='%(refname:short) * %(authorname) * %(committerdate:relative)' refs/remotes/ | column -t -s '*'
undo = reset HEAD^
fpr = "!pr() { git fetch origin pull/$1/head:pr-$1; git checkout pr-$1; }; pr"
append = commit --amend --no-edit
reword = commit --amend --reedit-message HEAD
reauthor = commit --amend --no-edit --reset-author
[pretty]
changes = format:%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset
@jprosevear
Copy link

Append is proving the most used so far

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