Skip to content

Instantly share code, notes, and snippets.

@alexsavio
Created November 13, 2019 21:02
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 alexsavio/75cd51401efc9dedf523a6483071bc5e to your computer and use it in GitHub Desktop.
Save alexsavio/75cd51401efc9dedf523a6483071bc5e to your computer and use it in GitHub Desktop.
.gitconfig
[alias]
co = checkout
br = branch
ci = commit
st = status
unstage = reset HEAD --
undo = reset --soft HEAD~1
last = log -1 HEAD
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%C
reset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches
filter-deleted = "!sh -c 'git log --diff-filter=D --summary | grep delet
e'"
delete-merged = "!f() { \
git checkout --quiet master \
&& \
git branch --merged \
| \
grep --invert-match '\\*' \
| \
xargs -n 1 git branch --delete; \
git checkout --quiet @{-1} \
; \
}; f"
delete-merged-remote = "!f() { \
git checkout --quiet master \
&& \
git branch --remote --merged \
| \
grep --invert-match 'master' \
| \
xargs -n 1 echo \
| \
awk '{ sub(/origin\\//, \"\"); print }' \
| \
xargs -I {} git push origin :{} \
; \
}; f"
delete-local-tags = tag -l | tag -d
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
changelog = log --pretty=%s --first-parent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment