-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
151 lines (149 loc) · 6.98 KB
/
.gitconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
[user]
name = Gary Oberbrunner
email = [email protected]
[pretty]
twolines = tformat:%C("#aaaaaa ul")%h%C(reset) %an, %cr: %d%n. . . . %C(yellow)%w(70,0,8)%s%C(reset)
[alias]
ll = log -10 --graph --date-order --format=twolines
ogl = !ogl --all
tube = log --graph --format=oneline --abbrev-commit --decorate --color
# tags = for-each-ref --sort=taggerdate --format '%(taggerdate:short)%09%(tag)' 'refs/tags'
# Show all tags in date order, with "*" for annotated tags
tags = for-each-ref --sort=creatordate --format '%(creatordate:short): %(refname:lstrip=2)%(if)%(taggerdate)%(then)*%(end)' 'refs/tags'
alias = config --get-regexp 'alias.*'
ff = merge --ff-only @{u}
outgoing = log --format=\"%aD: %aN [%h]%n %C(yellow)%s%C(reset)\" @{u}..HEAD
outgoing-all = log --format=twolines --branches --not --remotes
incoming = !git fetch && git log ..@{u}
ga-merge = merge --no-commit --no-ff --log=9999
lg1 = log --graph --date-order --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(black)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold red)%d%C(reset)' --all
lg2 = log --graph --date-order --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold red)%d%C(reset)%n'' %C(black)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
# Show the latest ancestor of HEAD that's on a different branch; that's usually where this branch branched from.
# May only work if this branch is not merged, e.g. a topic branch.
branch-base = !git show-branch -a 2>/dev/null | grep '^[ +-]*\\*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -n1 | perl -pe 's/.*?\\[(.*?)\\].*/\\1/'
current-branch = rev-parse --abbrev-ref HEAD
accept-ours = "!f() { git checkout --ours -- \"${@:-.}\"; git add -u \"${@:-.}\"; }; f"
accept-theirs = "!f() { git checkout --theirs -- \"${@:-.}\"; git add -u \"${@:-.}\"; }; f"
summary = !"git status -s -b --untracked-files=no; echo "$(tput setaf 1)*** OUTGOING:$(tput sgr0)"; git outgoing -n2; echo "$(tput setaf 2)*** HEAD:$(tput sgr0)"; git show --format='%ad%n %ar [%h]: %aN%n %s' --quiet HEAD; git stash list; echo "$(tput setaf 5)*** UNPUSHED:$(tput sgr0)"; git ll --branches --not --remotes"
# Summarize a single commit, e.g. to reference it somewhere
summarize=show --format='%h \"%s\"' --quiet
# Show recent branches, in a nice format
branches=for-each-ref --sort=-authordate --format='%(authordate:short) %(color:blue)%(refname:short) %(color:yellow)%(upstream:track)%0a ...%(color:red)%(subject)' refs/heads
# Ignore certain files/dirs locally -- useful for JS projects that check in builds
ignore=update-index --skip-worktree
unignore=update-index --no-skip-worktree
ignored=!git ls-files -v | grep "^S"
# quick status: one line per file, ignore untracked
st=status -s -uno
amend-quick=commit --amend --no-edit
dc=diff --cached
top=rev-parse --show-toplevel
# Show complete short status of all files, even ignored
file-status="!f() { cd -- ${GIT_PREFIX:-.}; sorted=$(printf '%s\\n' $(realpath --relative-to $(pwd) $@) | sort); for f in $sorted; do st=$(git status -s \"$f\"); lsf=$(git ls-files \"$f\"); if [ -n \"$st\" ]; then echo \"$st\"; elif [ -n \"$lsf\" ]; then echo \" $lsf\"; else echo \"?? $f\"; fi; done }; f"
# Git add with fuzzy matching courtesy of fzf:
fza = "!git status --porcelain | fzf -m | cut -c4- | (cd $(git rev-parse --show-toplevel); xargs -d\\\\n -t -o git add)"
# Branch-switching history from reflog:
hist = !"git reflog | grep 'checkout:' | head -n10 | perl -ne 'if ($_ =~ m/checkout: moving from ([^ ]*)/) {print \"$.: $1\n\"}'"
s1 = switch @{-1}
s2 = switch @{-2}
s3 = switch @{-3}
s4 = switch @{-4}
s5 = switch @{-5}
s6 = switch @{-6}
s7 = switch @{-7}
s8 = switch @{-8}
s9 = switch @{-9}
s10 = switch @{-10}
# Switch to branch with fzf:
sw = !git checkout $(git branch -a --format '%(refname:short)' | sed 's~origin/~~' | sort | uniq | fzf)
# Show all branches proceeding from a ref
log-from = "!f() { git log --oneline --graph $(git branch --all --contains \"$1\" --format='%(objectname)') \"^${1}~\"; }; f"
ogl-from = "!f() { ogl $(git branch --all --contains \"$1\" --format='%(objectname)') \"^${1}~\"; }; f"
ggraph = !git graph -s round -n200 -f '%h %an %as:%d %s' --color always | $PAGER
# Apply staged "fixup" changes to any commit $1.
# After adding changes, use as "git fixup <SHA>". It creates a
# "fixup!" commit and silently rebases it in.
# See https://arialdomartini.github.io/git-fixup
fixup = "!f() { TARGET=$(git rev-parse $1); git commit --fixup=$TARGET ${@:2} && GIT_SEQUENCE_EDITOR=true git rebase -i --autostash --autosquash $TARGET^; }; f"
[Gui]
fontdiff = -family \"Droid Sans Mono Dotted\" -size 10 -weight normal -slant roman -underline 0 -overstrike 0
warndetachedcommit = true
encoding = utf-8
[push]
default = current
# when pushing, push all annotated tags
followTags = true
[diff]
renamelimit = 0
renames = copies
guitool = kdiff3
submodule = log
colorMoved = default
[merge]
tool = kdiff3
conflictStyle = diff3
[core]
editor = emacsclient -c -a \"\"
preloadindex = true
fscache = true
autocrlf = false ### (this is best left unset or false; no CRLF conversion at all)
# Use per-repo .gitattributes instead!
# pager = command -v delta > /dev/null && delta --syntax-theme 'GitHub' || $PAGER
excludesfile = ~/.gitignore
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[mergetool]
prompt = false
[status]
# magit needs this even though it's the default,
# otherwise it recursively shows all untracked files (which can be slow).
showUntrackedFiles = normal
submoduleSummary = true
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
[include]
# Include machine-local gitconfig, e.g. for Windows/Mac tool paths
path = .gitconfig-local
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
light = true
[rerere]
enabled = true
[fetch]
writecommitgraph = false
recurseSubmodules = on-demand
[gc]
writeCommitGraph = false
[pull]
ff = only
[init]
defaultBranch = main
#[url "ssh://[email protected]/"]
# insteadOf = https://github.com/
[core]
packedGitLimit = 2048m
packedGitWindowSize = 2048m
compression = 0
longpaths = true
[pack]
deltaCacheSize = 1024m
packSizeLimit = 2048m
windowMemory = 2048m
window = 1
[credential "https://github.com"]
helper = !gh auth git-credential
[credential "https://gist.github.com"]
helper = !gh auth git-credential
[commit]
template = /Users/garyo/.gitmessage