configs/roles/config/files/.config/git/config

47 lines
1.9 KiB
Plaintext
Executable File

[user]
name = exu
email = mrc@frm01.net
[core]
sshCommand = "ssh -i $HOME/.ssh/id_ed25519_git"
[init]
defaultBranch = main
# Some popular options to test:
# https://jvns.ca/blog/2024/02/16/popular-git-config-options/#merge-conflictstyle-zdiff3
# https://blog.gitbutler.com/how-git-core-devs-configure-git/
[merge]
conflictstyle = zdiff3 # 3way merge conflict. current change, original, incoming change
[diff]
algorithm = histogram # better handling of code movement
colorMoved = plain # different color for moved code
mnemonicPrefix = true # diff prefix i (index), w (working dir) or c (commit) instead of a and b
renames = true # better renames detection
[branch]
sort = -committerdate # sort by date of last commit
[tag]
sort = taggerdate # sort by creation date
# sort = version:refname # sorting by version numbers
[push]
autoSetupRemote = true # automatically set upstream branch
followTags = true # always push local tags
[pull]
rebase = true # auto rebase local commits
[fetch]
prune = true # remove local leftovers on fetch
pruneTags = true # remove local tags on fetch
all = true # fetch all
[commit]
verbose = true # show detailed changes
[help]
autocorrect = prompt # if I ever need to use the CLI
[alias]
# use like this: git mr [REPO] [MERGE REQUEST]
# see https://stackoverflow.com/a/50834005 (GitLab)
# see https://gist.github.com/gnarf/5406589 (GitHub, modified to be similar to GitLab)
mr = !sh -c 'git fetch -fu $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
pr = !sh -c 'git fetch -fu $1 refs/pull/$2/head:pr-$1-$2 && git checkout pr-$1-$2' -
# checkout latest tag
latest = !sh -c 'git describe --tags $(git rev-list --tags --max-count=1) | xargs git checkout' -
# conditonal config
[includeIf "gitdir:**gitprojects/occ/**"]
path = ~/.config/git/occ