Skip to content

Instantly share code, notes, and snippets.

@matheusd
Created October 13, 2020 11:39
Show Gist options
  • Save matheusd/568a6b94a6c850980d92f1476cce33b0 to your computer and use it in GitHub Desktop.
Save matheusd/568a6b94a6c850980d92f1476cce33b0 to your computer and use it in GitHub Desktop.
git aliases
[alias]
l = !"git lshort --graph"
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
cp = cherry-pick
cpc = cherry-pick --continue
st = status
mere = merge --rerere-autoupdate
snames = show --name-only
rb = rebase
rbc = rebase --continue
rbsign = rebase --exec 'git commit --amend --no-edit -n -S'
newdate = !"GIT_COMMITTER_DATE=\"$(date)\" git commit --amend --no-edit --date \"$(date)\""
lshort = log --decorate --abbrev-commit --format=format:'%C(bold green)%ci%C(reset) %<(20,trunc)%C(dim white)%an%C(reset) %C(bold blue)%h%C(reset) %<(60,trunc)%C(white)%s%C(reset) %C(auto)%D%C(reset)'
lmsg = log --format=format:'%an %s'
lggo = log --date='format:%Y%m%d%H%M%S' --abbrev=12 --pretty='format:%ad-%h %s'
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment