files/gitconfig
# vim: ft=dosini
# Core
[core]
editor = nvim
excludesfile = ~/.gitignore
templatedir = ~/.git
attributesfile = ~/.gitattributes
trustctime = false
pager = "less --tabs=4"
precomposeunicode = false
untrackedCache = true
hooksPath = "~/.dotfiles/files/git-hooks"
[protocol]
# Requires git 2.18.0+
version = 2
[fetch]
# Requires git 2.24.0+
writeCommitGraph = true
# Prune branches when fetching
prune = true
fsckobjects = true
[transfer]
fsckobjects = true
[receive]
fsckobjects = true
[help]
autocorrect = 1
[advice]
skippedCherryPicks = false
[submodule]
# Requires git 2.9.0+
fetchJobs = 0
[pack]
threads = 0
[user]
name = Albert Wang
email = git@albertyw.com
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
# Git command Configuration
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'
lg-notags = log --graph --pretty=format:'%Cred%h%Creset - %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'
s = status -uno
todo = grep -n -e TODO -e FIXME -e XXX -e OPTIMIZE -e FIX-ME
loc = !git diff --stat `git hash-object -t tree /dev/null` | tail -1 | cut -d' ' -f5
cherrypick = cherry-pick
blame = blame -cwC
branches = branch -vv
find = !~/.dotfiles/scripts/git/find
browse = !~/.dotfiles/scripts/git/git-browse/git_browse/browse.py --path=${GIT_PREFIX:-./}
reviewers = !~/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py -i albertyw -c -j ~/.gitreviewers.json
size = !~/.dotfiles/scripts/git/size
userstats = !~/.dotfiles/scripts/git/userstats
findreplace = !~/.dotfiles/scripts/git/findreplace
finddelete = !~/.dotfiles/scripts/git/finddelete
[grep]
linenumber = true
[blame]
date = local
[log]
abbrevCommit = true
date = local
# Follow file renames when running git log on a file
follow = true
[status]
submoduleSummary = true
[push]
default = current
# Branching/Merging
[branch]
autosetuprebase = always
# Sort branches by committer date instead of alphabetical
sort = committerdate
[pull]
rebase = true
[rebase]
# Automatically stash and unstash changes when rebasing or pulling
# https://cscheng.info/2017/01/26/git-tip-autostash-with-git-pull-rebase.html
autoStash = true
updateRefs = true
[diff]
algorithm = histogram
tool = vimdiff
indentHeuristic = true
renames = copies
renameLimit = 1000
submodule = log
colorMoved = default
colorMovedWS = allow-indentation-change
[difftool]
prompt = false
[merge]
conflictstyle = diff3
log = true
[rerere]
enabled = true
[apply]
whitespace = fix
# Colors
[color]
ui = true
[color "grep"]
filename = magenta
match = bold red
linenumber = bold blue
[color "diff"]
meta = bold cyan
[url "ssh://git@github.com/"]
insteadOf = https://github.com/
[init]
# Initialize new repositories with branch name "master"
defaultBranch = master
# Overrides
# This must go at the bottom in order to override configs above
[include]
# REQUIRES GIT 1.7.10+
path = .gitconfig_local