Skip to content

Instantly share code, notes, and snippets.

@EtsuNDmA
Last active April 7, 2021 06:42
Show Gist options
  • Save EtsuNDmA/b30f46363d91a30b58f38be72986bd90 to your computer and use it in GitHub Desktop.
Save EtsuNDmA/b30f46363d91a30b58f38be72986bd90 to your computer and use it in GitHub Desktop.
Aliases for git commands
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold cyan)<%an>%Creset' --abbrev-commit
ss = status -s
b = branch
ca = commit -a -m
last = log -1 HEAD
co = checkout
# fuzzy checkout by ticket number for branches like feature/cool-stuff-abc1234
fco = "!f() { git branch -a | egrep -m1 \"(feature|hotfix)/.*${1}\" | sed \"s/remotes\\/origin\\///\" | xargs git checkout; }; f"
amend = commit --amend --no-edit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment