Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
151 lines (150 sloc) 4.5 KB
# .-. .-. .-. .-. .-. .-.
# `._.' `._.' `._.' `._.' `._.' `._.' `
#
# Git config
# https://github.com/rafi/.config
#
[include]
path = users/current
[core]
excludesfile = ~/.config/git/ignore
hooksPath = ~/.config/git/hooks
# Do NOT auto-convert CRLF line endings into LF
autocrlf = false
# Do NOT check if converting CRLF is reversible
safecrlf = false
# Whitespace detection (only warnings)
whitespace = trailing-space,space-before-tab
[credential]
helper = cache --timeout=3600
# [init]
# templatedir = ~/.config/git/template
[pager]
show-branch = true
status = true
diff = diff-so-fancy | less --tabs=1,3
show = diff-so-fancy | less --tabs=1,3
[pretty]
log = %C(240)%h%C(reset) -%C(auto)%d%Creset %s %C(242)(%an %ar)
detailed = %C(cyan)%h %C(red)%ad %C(blue)[%an]%C(magenta)%d %C(white)%s
shorter = %C(auto)%D %C(240)--%C(242)%gD%N %ad by %C(white)%cn%C(reset)
multiline = %C(blue)──────%Creset%n %C(auto)commit %h %C(auto) %D%Creset%n %C(cyan)%an%Creset | %Cgreen%cr%Creset%n%+B
[status]
submodulesummary = true
showUntrackedFiles = all
[fetch]
recurseSubmodules = true
[push]
# Defines the action git push should take if no refspec is explicitly given:
# current = Push the current branch to update a branch with the same name on the receiving end
default = current
# https://git-scm.com/docs/git-config#git-config-pushfollowTags
followTags = true
[submodule]
fetchJobs = 8
[rerere]
enabled = true
[diff]
algorithm = patience
renames = copies
mnemonicprefix = true
compactionHeuristic = true
tool = bc3
[merge]
tool = bc3
summary = true
verbosity = 1
stat = true
# Standard diff is two sets of final changes.
# This introduces the original text before each side's changes.
# https://git-scm.com/docs/git-config#git-config-mergeconflictStyle
conflictstyle = diff3
[mergetool]
prompt = false
keepBackup = true
writeToTemp = true
[transfer]
# https://git-scm.com/docs/git-config#git-config-transferfsckObjects
# via https://groups.google.com/forum/#!topic/binary-transparency/f-BI4o8HZW0
fsckobjects = true
[color]
ui = true
pager = true
showbranch = true
diff = auto
status = auto
branch = auto
interactive = auto
[color "branch"]
plain = yellow
current = magenta bold
local = blue bold
remote = white
upstream = green bold
[color "diff"]
plain = normal
old = red
new = green
commit = yellow
meta = blue
frag = cyan
func = yellow bold
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "status"]
header = 243
added = green
changed = red
untracked = blue
branch = green bold
nobranch = red
[url "git@github.com:"]
insteadOf = gh:
[alias]
s = status -sb
f = fetch --prune
c = commit -v
cm = commit -vm
br = branch -v
st = status
ck = checkout
t = tag --column
tn = tag -n
d = diff
ds = diff --staged
dw = diff --color-words
dh = diff --color-words HEAD
dp = !git log --pretty=oneline | fzf | cut -d ' ' -f1 | xargs -o git show
patch = !git --no-pager diff --no-color
prune = fetch --prune
stash-all = stash save --include-untracked
w = whatchanged --decorate
wp = whatchanged --decorate -p
#===============================================
sm = submodule
smu = submodule foreach git pull origin master
lcrev = log --reverse --no-merges --stat @{1}..
lcp = diff @{1}..
#===============================================
tree = log --graph --all --oneline --decorate
lb = log --graph --simplify-by-decoration --pretty=shorter --all --notes --date-order --relative-date
log = log --pretty=log
lg = log --graph --pretty=log --all
lgd = log --graph --pretty=log
lgw = !sh -c '"while true; do clear; git lg -15; sleep 5; done"'
#===============================================
bf = !git diff --name-only "$(git base-branch)..@"
post = !sh -c 'git format-patch --stdout $1 | ix' -
sync-tags = fetch --prune origin '+refs/tags/*:refs/tags/*'
recent-branches = !git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short)'
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
#===============================================
# Take a snapshot of your current working tree without removing the changes from your tree.
# via http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
snapshots = !git stash list --grep snapshot
You can’t perform that action at this time.