-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
275 lines (223 loc) · 10 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
[user]
name = Manoj Srivastava
email = srivasta@golden-gryphon.com
signingkey = 0xC5779A1C
[collumn]
ui = auto
[commit]
gpgsign = true
[core]
excludesfile = /home/srivasta/etc/global-gitignore
[diff]
renames = copies
renamelimit = 200
mnemonicprefix = true
[diff "lisp"]
xfuncname = "^(\\(.*)$"
[diff "texinfo"]
xfuncname = "^@node[ \t][ \t]*\\([^,][^,]*\\)"
[interactive]
singleKey = true
[merge]
tool = ediff
[mergetool "ediff"]
cmd = ~/bin/git-mergetool-emacsclient-ediff "$LOCAL" "$REMOTE" "$MERGED" "$BASE"
trustExitCode = true
[mergetool]
prompt = false
[merge "dpkg-mergechangelogs"]
name = debian/changelog merge driver
driver = dpkg-mergechangelogs -m %O %A %B %A
[merge "merge-changelog"]
name = GNU-style ChangeLog merge driver
driver = /usr/local/bin/git-merge-changelog %O %A %B
[push]
default = upstream
[transfer]
fsckObjects = true
[fetch]
fsckObjects = true
[receive]
fsckObjects = true
#[init]
# templatedir = $XDG_CONFIG_HOME/git_templates
[gitpkg]
deb-dir = /scratch/sandbox/staging/input
prebuild-target = clean
#pre-export-hook = /usr/share/gitpkg/hooks/pristine-tar-pre-export-hook
pre-export-hook = /home/srivasta/bin/gitpkg-pre-commit
exit-hook = /home/srivasta/bin/gitpkg-build
create-fake-orig = false
force-overwrite-orig = false
[gitpkg-build]
results-dir = /scratch/sandbox/staging/results
debarchive = /backup/debarchive
no-sign = 1
command = ssh
options = -t
options = buildd.internal.golden-gryphon.com
options = /usr/local/bin/remote_build
options = PACKAGE_NAME_HERE
# command = pdebuild
# options = --auto-debsign
# options = --
# options = --twice
##### Merging #############
# Sometimes when you ask git to merge branch A into branch B, it will
# decide that it doesn’t want to merge and it will instead turn A and
# B into clones of each other. Your branch has effectively vanished
# from history. There is no longer any indication that you were
# working on a side branch; it looks like you were working directly on
# master. And if it turns out that there were bugs in your new feature
# (which, you know, sometimes happens), you can’t reverse the
# merge-commit because there is no merge-commit. You will have to
# reverse every single commit you made, in reverse order, or worse.
# Git calls the history erasing “fast-forwarding”.)
# Fast-forward merging makes sense for short-lived branches, but in a
# more complex history, non-fast-forward merging may make the history
# easier to understand, and make it easier to revert a group of
# commits.
#
# + short-lived branches are very easy to create and use in Git
# + short-lived branches often isolate many commits that can be
# reorganized freely within that branch
# + those commits are actually part of the main branch: once
# reorganized, the main branch is fast-forwarded to include them.
# it really depends on your development workflow:
# + if it is linear, one branch makes sense.
# + If you need to isolate features and work on them for a long period
# of time and repeatedly merge them, several branches make sense.
[rerere]
enabled = 1
[color]
diff = auto
status = auto
branch = auto
ui = auto
interactive = auto
grep = auto
[color "branch"]
current = green
local = yellow
remote = red
[color "diff"]
old = red
new = green
meta = yellow
frag = magenta
[color "status"]
added = green
changed = yellow
untracked = red
[column]
ui = auto
[branch]
autosetupmerge = true
[pager]
status = true
show-branch = true
[rebase]
autosquash = true
[format]
numbered = true
[alias]
# Generally, doing incremental "git gc" is the right approach, and better
# than doing "git gc --aggressive". It's going to re-use old deltas, and
# when those old deltas can't be found (the reason for doing incremental GC
# in the first place!) it's going to create new ones.
#
# On the other hand, it's definitely true that an "initial import of a long
# and involved history" is a point where it can be worth spending a lot of
# time finding the *really*good* deltas. Then, every user ever after (as
# long as they don't use "git gc --aggressive" to undo it!) will get the
# advantage of that one-time event. So especially for big projects with a
# long history, it's probably worth doing some extra work, telling the delta
# finding code to go wild.
# schedule a full agressive repack once. -f forces a full --no-reuse-delta
full-repack = repack -a -d -f --window=512 --depth=512
diffstat = diff --stat -r
# Diff by highlighting inline word changes instead of whole lines
wdiff = diff --word-diff
lc = log ORIG_HEAD.. --stat --no-merges
last = log -1 HEAD
fetch-all = !git remote | xargs -n 1 git fetch
prune-all = !git remote | xargs -n 1 git remote prune
gitkconflict = !gitk --left-right HEAD...MERGE_HEAD
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; edit `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
co = checkout
ci = commit -s
st = status -sb
br = branch
cp = cherry-pick
pi = cherry-pick
pff = pull --ff-only
dt = difftool
mt = mergetool
df = diff
llog = log --date=local
k = !gitk
new = diff ORIG_HEAD
pwb = rev-parse --abbrev-ref HEAD
amend = commit --amend
up = pull --rebase
in-tag = name-rev --name-only
in-br = branch --contains
#### LOG ###
# By default, git re-orders the history to make sure every
# commit is shown in its actual time order, not the story
# order. Using topo-order tells git to show things in
# “topological” (story) order.
# --topo-order --decorate --first-parent tells git to show
# things in story order and to tell that story from my point
# of view. It’s sometimes interesting to see every commit
# that one of your coworkers did in their branch, but often
# you just want to see the merge-commit and move on.
# --first-parent tells git to skip over the details of every
# branch that isn’t a linear parent of yours. Generally this
# means you’ll see a simplified history of what’s been going
# on, without the intricacies of what happened on forked
# branches while they were forked off.
lg = log -p
lpc = log -p -c --no-merges
llog = log --date=local
l = log --pretty=format:'%C(yellow)%h%C(white) %an <%ae> %>|(80)%ai%Creset%n%C(bold)%w(0,4,4)%s%C(reset)%n%+b'
ll = log --stat
# Still show author and title, but in a graph like fashion
graph = log --graph --pretty=short --decorate --abbrev-commit --branches
# Show branches, tags in git log
olg = log --pretty=oneline --decorate --abbrev-commit
# Same, but show other branches in a graph
sgraph = log --graph --pretty=oneline --decorate --abbrev-commit --all --topo-order
# Like sgraph, but has time and commiter info -- decorations are not yet colored
# Will replace sgraph when we get git 1.8.3
lx = log --graph --pretty=format:'%C(Yellow)%h%Creset%d %Cgreen(%cr)%Creset %C(bold blue)%an%Creset %Cred\"%Creset%s%Cred\"%Creset' --decorate --abbrev-commit --all --topo-order
# One line, commit when who description
slg = log --pretty=format:'%Cblue%h %Cred%ar %Cblue%an %Creset t - %s'
who = shortlog -n -s --no-merges
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
ignored = "!git ls-files --others --exclude-standard"
unstaged = diff
staged = diff --cached
changes = "!sh -c 'git status | sed -n \"/Untracked/N;//N;1,//d;s/^#/?/p\"; git diff --name-status -r \"$@\"' -"
both = diff HEAD
pending = !git --no-pager log --stat origin/master..master && echo
wu = log --stat origin..@{0}
undo = reset --hard
unstage = reset HEAD --
purge = !git checkout $(git rev-parse --show-cdup) && git clean -xdf
track = !sh -c 'git branch --track "$0" "$1" && git checkout "$0"'
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
alias = !sh -c '[ -n \"$1\" -a -z \"$2\" ] && git config --global alias.\"$0\" \"$1\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1'
get-tracking-remote = !git config branch.$(git name-rev --name-only HEAD).remote | awk '{printf \"%s%s\", (($1 == \".\") ? \"\" : $1), (($1 != \".\") ? \"/\" : \"\")}'
get-tracking-branch = !basename $(git config branch.$(git name-rev --name-only HEAD).merge)
show-tracking = !echo \"$(git get-tracking-remote)$(git get-tracking-branch)\"
diff-tracking = !git diff $(git show-tracking)
ctags = !.git/hooks/ctags
lp = log -p
dos2unix = !git diff --name-only --cached | xargs dos2unix
[gpg]
program = gpg
[github]
user = srivasta