Skip to content

Instantly share code, notes, and snippets.

@oidualc
Last active April 7, 2024 09:19
Show Gist options
  • Save oidualc/6601ca6d900c7f0784742a5a66910fd4 to your computer and use it in GitHub Desktop.
Save oidualc/6601ca6d900c7f0784742a5a66910fd4 to your computer and use it in GitHub Desktop.
My git configuration
[credential]
helper = store
[alias]
stash-unapply = !git stash show -p | git apply -R
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
co = checkout
br = branch
ci = commit
st = status
unstage = reset HEAD
last = log -1 HEAD
oldest-ancestor = !bash -c 'diff --old-line-format= --new-line-format= <(git rev-list --first-parent \"${1:-master}\") <(git rev-list --first-parent \"${2:-HEAD}\") | head -1' -
log-merge = "!f() { git log --stat \"$1^..$1\"; }; f"
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
[rerere]
enabled = true
autoupdate = true
[pull]
rebase = true
[push]
followTags = true
autoSetupRemote = true
[init]
defaultBranch = main
[rebase]
autosquash = true
[fetch]
prune = true
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
light = false
line-numbers = true
[merge]
ff = false
conflictstyle = diff3
[diff]
colorMoved = default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment