Skip to content

Instantly share code, notes, and snippets.

@bmsrox
Last active July 18, 2025 07:13
Show Gist options
  • Save bmsrox/c34e097d0cdfb16c820b7be3ad8a30ae to your computer and use it in GitHub Desktop.
Save bmsrox/c34e097d0cdfb16c820b7be3ad8a30ae to your computer and use it in GitHub Desktop.
Git config aliases
b = branch
s = status -s
c = !git add --all && git commit -m
l = log --pretty=format:'[%C(blue)%h%C(white)]%C(red)%d %C(white)%s -> %C(cyan)%cn, %C(green)%cr'
lg = log --all --decorate --oneline --graph --pretty=format:'[%C(blue)%h%C(white)]%C(red)%d %C(white)%s -> %C(cyan)%cn, %C(green)%cr'
amend = !git add --all && git commit --amend --no-edit
#git count feat/fix/chore
count = !git shortlog -s --grep
find = "!f(){ git branch | grep $1; }; f"
st = !git add --all && git stash
sw = "!f(){ git find $1 | xargs git switch; }; f"
sws = "!f(){ git st && git find $1 | xargs git switch; }; f"
co = "!f(){ git find $1 | xargs git switch; }; f"
cos = "!f(){ git st && git find $1 | xargs git checkout; }; f"
#p = "!f(){ echo Are you sure you want to run git push? [y/N]; read a; if [ $a = y ] || [ $a = Y ]; then git push; else echo Command push canceled.; fi;}; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment