-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
180 lines (144 loc) · 5.01 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# .gitconfig
# Yves Chevallier 2017
[user]
name = Yves Chevallier
email = [email protected]
[github]
user = nowox
token = token
[credential]
helper=manager
[core]
editor = vim # Because by default it's vi and vi is not always mapped to vim
ignorecase = false
autocrlf = false
filemode = false
compression = 0 # Faster on Cygwin
whitespace = cr-at-eol
excludesfile = \\\\strne01-a.csem.local\\data-e\\users\\Ycr\\Documents\\gitignore_global.txt
[help]
autocorrect = 1 # 0.1 seconds to autocorrect mistypen commands.
[color]
ui = auto
[web]
browser = google-chrome
[advice]
pushNonFastForward = false
statusHints = false
commitBeforeMerge = false
resolveConflict = false
implicitIdentity = false
detachedHead = false
[color "grep"]
linenumber = yellow bold
match = red
filename = green
function = magenta
[color "status"]
added = "#99cc99"
changed = "#f2777a"
untracked = "#ffcc66"
deleted = magenta bold
branch = "#6699cc" bold
nobranch = bold ul blink "#f99157"
[rerere]
enabled = true
autoUpdate = true
[rebase]
stat = true
[pull]
rebase = true
[push]
default = simple
[grep]
patternType = perl
lineNumber = true
[diff]
tool = bc4
[difftool]
prompt = false
[difftool "bc4"]
cmd = "\"/mnt/c/Program Files/Beyond Compare 4/BComp.exe\" \"$(wslpath -w \"$LOCAL\")\" \"$(wslpath -w \"$REMOTE\")\" /lefttitle=\"$(wslpath -w \"$LOCAL\")\" /righttitle=\"$(wslpath -w \"$REMOTE\")\""
[merge]
tool = bc4
[log]
abbrevCommit = true
decorate = true
date = iso
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = true
[mergetool "bc4"]
cmd = "\"/mnt/c/Program Files/Beyond Compare 4/Bcomp.exe\" \"$(wslpath -w \"$LOCAL\")\" \"$(wslpath -w \"$REMOTE\")\" \"$(wslpath -w \"$BASE\")\" \"$(wslpath -w \"$MERGED\")\""
[alias]
# Checkout
o = checkout
ob = checkout -b
# Move HEAD forward/Backward
fw = "!git log --pretty=oneline --all | grep -B1 `git rev-parse HEAD` | head -n1 | egrep -o '[a-f0-9]{20,}' | xargs git checkout"
bw = "!git checkout HEAD~1"
# Branches
b = branch
lsb = "!git for-each-ref --sort=-committerdate refs/heads/ \
--format='%(color:blue)%(objectname:short)%(color:bold green) %(refname:short)%(color:reset) %(contents:subject)%(color:dim white) - %(authorname) %(color:reset)%(color:yellow)(%(color:green)%(committerdate:relative)%(color:reset)%(color:yellow))%(color:reset)'"
# Commit
c = commit
ca = commit -a # Stage all modified files
cm = commit -m # Commit with message
cam = commit -a -m # Commit all modified files with message
# Status
s = status -s -b # Status in short format
su = status -s -b -uno # Doesn't show untracked files
# Diff
d = diff
dh = diff HEAD # Diff Filesystem <-> HEAD
dc = diff -C --cached # Diff Staged <-> HEAD
ds = diff -C --ignore-space-at-eol --ignore-space-change
dt = difftool
# Integrity
fk = fsck # Verifies the connectivity and validity of the db
fu = fsck --unreachable # List commits unlinked to any reference nodes
# Grep
g = grep --show-function --heading --break -I
gh = "!f() { git g $2 $(git rev-list --max-count=$1 HEAD); }; f"
# Replace
pie = "!f() { \
git ls-files -z | xargs -0 perl -e ' \
my $eval = shift @ARGV; \
foreach my $file (@ARGV) { \
next unless -f $file; \
open my $fd, $file; \
my $content = do { local $/; <$fd>}; \
close $fd; \
my $new = do { $_ = $content; eval $eval; }; \
if ($content ne $new) { \
open my $fd, \">\", $file; \
print $fd $_; \
close $fd; \
} \
} \
' \"$1\"; }; f"
# Log / Tree
l = log -n30 --boundary --graph --pretty=format:'%C(bold blue)%h%C(bold green)%<|(20)% ar%C(reset)%C(white)% s %C(dim white)-% an%C(reset)%C(auto)% d%C(bold red)% N'
la = log -n30 --boundary --graph --pretty=format:'%C(bold blue)%h%C(bold green)%<|(20)% ai%C(reset)%C(white)% s %C(dim white)-% an%C(reset)%C(auto)% d%C(bold red)% N'
# Files
ls = ls-files
# Clean
x = clean -xfd
xx = !git clean -xfd && git reset --hard HEAD
# Merge
m = merge
ma = merge --abort
mc = merge --continue
ms = merge --skip
# Reset
r = reset HEAD
rh = reset --hard HEAD
[init]
templateDir = /usr/share/git-core/templates
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f