Skip to content

Instantly share code, notes, and snippets.

@bmsrox
Created July 19, 2021 03:47
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 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
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment