Skip to content

Instantly share code, notes, and snippets.

@nipafx
Created August 8, 2023 15:04
Show Gist options
  • Save nipafx/283fcb8a7deb504d9041ce3e65c6dc22 to your computer and use it in GitHub Desktop.
Save nipafx/283fcb8a7deb504d9041ce3e65c6dc22 to your computer and use it in GitHub Desktop.
My Git aliases
[alias]
st = status --branch --short
look = log --graph --pretty='%C(red)%h%Creset %C(green)%ad%Creset %C(yellow)%<(15,trunc)%an%Creset %s %C(bold blue)%D%Creset' --date=format-local:'%d.%m.%Y %H%M'
look-close = log --graph --pretty='%C(red)%h%Creset %C(green)%cd%Creset %C(yellow)%<(15)%cn%Creset %C(bold blue)%D%Creset%n %C(dim green)%ad%Creset %C(dim yellow)%<(15)%an%Creset %s' --date=format-local:'%d.%m. %H%M'
hist = log --pretty='%C(red)%h%Creset %C(green)%cd%Creset %C(yellow)%<(12,trunc)%an%Creset %s %C(auto)%D%Creset' --date=format-local:'%Y-%m-%d %H:%M'
wat = !git look -15
cd = checkout
patch = -c interactive.diffFilter='diff-highlight | less -FRX --tabs=4' add --patch
unstage = reset HEAD --
unstage-patch = reset HEAD --patch
eradicate = "!git reset --hard; git clean -fd"
com = commit -m
amend = commit --amend --no-edit
fixup = "!git commit --fixup=$1 #"
reword = commit --amend
reb = rebase --interactive --autosquash
reb-unpushed = rebase --interactive --autosquash @{upstream}
follow = log --follow -p
cp = cherry-pick
diff-prose = diff --word-diff --unified=5
please = push --force-with-lease
# I also have a terminal shortcut:
# alias g='git st; echo ''; git wat -5'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment