# vim:ft=gitconfig # ~/.gitconfig # ============================================================================ # This Git configuration contains sane defaults for my workflow. # I work with Git on Windows and Linux, and some configuations might # use different locations. This mainly contains the aliases I want # to keep consistent between machines. {{/* This file supports Go's text/template language. */ -}} [core] excludesfile = !{{ .chezmoi.homeDir }}/.gitignore [init] defaultBranch = main [push] autoSetupRemote = true default = current [user] name = {{ .git_name }} email = {{ .git_email }} [alias] staash = stash --all trueblame = blame -w -C -C -C wdiff = diff --word-diff fpush = push --force-with-lease sdiff = diff --staged nadd = add -N . padd = add -p . undostage = restore --staged . # Just for the memes fixed = commit --amend --no-edit gud = push --force-with-lease rekt = !git reset --hard && git clean -df [rerere] enabled = true autoUpdate = true [branch] sort = committerdate {{ if eq .chezmoi.os "windows" -}} [credential "https://github.com"] helper = helper = !'C:\\Program Files\\GitHub CLI\\gh.exe' auth git-credential [credential "https://gist.github.com"] helper = helper = !'C:\\Program Files\\GitHub CLI\\gh.exe' auth git-credential {{ else if eq .chezmoi.os "darwin" -}} [credential "https://github.com"] helper = helper = !/opt/homebrew/bin/gh auth git-credential [credential "https://gist.github.com"] helper = helper = !/opt/homebrew/bin/gh auth git-credential {{ else -}} [credential "https://github.com"] helper = helper = !/usr/bin/gh auth git-credential [credential "https://gist.github.com"] helper = helper = !/usr/bin/gh auth git-credential {{ end -}} [pull] rebase = true [filter "lfs"] process = git-lfs filter-process required = true clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f