Skip to content

Instantly share code, notes, and snippets.

@zonque
Created September 27, 2019 08:31
Show Gist options
  • Save zonque/73ae71b1faf4148411d10c811bb9d782 to your computer and use it in GitHub Desktop.
Save zonque/73ae71b1faf4148411d10c811bb9d782 to your computer and use it in GitHub Desktop.
gitconfig gems
[alias]
sm = submodule
lol = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lsr = for-each-ref --format='%(committerdate:iso8601) %(committerdate:relative) %(refname)' --sort -committerdate
untracked = ls-files --other --exclude-standard
pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment