Skip to content

Instantly share code, notes, and snippets.

View vjandrea's full-sized avatar

Andrea Bergamasco vjandrea

View GitHub Profile
@vjandrea
vjandrea / git-config.sh
Last active January 26, 2026 16:20
git-config.sh
#!/bin/zsh
# ALIASES
git config --global alias.a "add ."
git config --global alias.fa "fetch --all --verbose"
git config --global alias.l "log --pretty=format:'%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(7,trunc)%aN%C(auto,reset)%s%C(auto,red)% %C(auto)%gD %D' --date=relative --decorate -20"
git config --global alias.last "log --oneline -1"
git config --global alias.refs "for-each-ref --format='%(if)%(HEAD)%(then)* %(else) %(end)%(color:blue)%(refname:short)%(color:reset) %(color:yellow)%(upstream:track)%(color:reset) %(color:cyan)%(upstream:remotename)%(color:reset)' refs/heads"
git config --global alias.s "status -s -b"
git config --global alias.list-gone '!git branch -vv | grep ": gone]"'
git config --global alias.prune-gone '!git branch -vv | grep ": gone]" | awk "{print \$1}" | xargs -r -n 1 git branch -D'