-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
165 lines (147 loc) · 4.73 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
[user]
name = Azat Khuzhin
email = [email protected]
[init]
defaultBranch = main
[core]
autocrlf = input
safecrlf = true
# This is not for dot_files repository.
# Because it may contain different _generated_ configs,
# and I don't think that it is a good idea to change indent in all configs.
#
# This is for repositories with source codes.
whitespace = blank-at-eol,-blank-at-eof,tab-in-indent,tabwidth=4
[sequence]
# https://github.com/MitMaro/git-interactive-rebase-tool
editor = interactive-rebase-tool
[add.interactive]
useBuiltin = false # required for git 2.37.0
[log]
mailmap = true
[sendemail]
smtpserver = /usr/bin/msmtp
[tag]
gpgSign = true
[push]
default = upstream
gpgSign = if-asked
[pull]
ff = only
[fetch]
parallel = 100
[submodule]
fetchJobs = 100
[color]
branch = auto
diff = auto
grep = auto
interactive = auto
showbranch = auto
status = auto
ui = auto
[color "branch"]
current = green
local = yellow
remote = red
[color "diff"]
meta = yellow
[color "grep"]
match = green
[color "status"]
changed = yellow
[merge]
log = 1000
conflictstyle = diff3
[tag]
sort = -v:refname
[branch]
sort = -authordate
[alias]
di = diff
ci = commit
cs = commit -S
cis = commit --signoff
amend = commit --amend
amn = commit --amend --no-edit
pi = cherry-pick
br = branch
mt = mergetool
co = checkout
ann = blame
st = status
patch = add --patch
prev = checkout HEAD^
hprev = reset --hard HEAD^
slog = log --show-signature
fixes = log --format=fixes -1
# from http://heipei.net/linux/files/configs/gitconfig
llog = log --date=short --format=\"%C(94)--------------------------------------------------------------------------------%n%C(24)%h %C(124)%ad %C(34)%an %C(22)<%ae>%C(130)%d%n%C(178)%s%+b\"
oneline = log --oneline
# Ahead
changes = !sh -c 'git log --oneline `git rev-parse --symbolic-full-name --abbrev-ref @{u}`...${u}'
# Or just use git-status
aheadbegind = !sh -c 'curr_branch=$(git rev-parse --abbrev-ref HEAD) && curr_remote=$(git config branch.$curr_branch.remote) && curr_merge_branch=$(git config branch.$curr_branch.merge | cut -d / -f 3) && git rev-list --left-right --count $curr_branch...$curr_remote/$curr_merge_branch | tr -s \\\\t \\|'
# see which patches are different between branches
branchonly = !sh -c 'git cherry HEAD ${1} | tr -d + | xargs -I{} git show {}' -
currentonly = !sh -c 'git cherry ${1} HEAD | tr -d + | xargs -I{} git show {}' -
mr-diff = !sh -c \"git di $(git merge-base ${1} me/${1}) me/${1} ${2:-master}\"
# Debian-like changelog
deb-changelog = !sh -c 'git --no-pager log --format=%ai\\ %aN\\ %n%n%x09*\\ %s%d%n'
staged = diff --cached
# sha1 of the current branch's HEAD
sha1 = !sh -c 'git rev-parse ${1-`echo HEAD`}' -
# shows a 7 character abbreviation of a reference, defaulting to HEAD
abbrev = !sh -c 'git rev-parse --short ${1-`echo HEAD`}' -
amk = am --keep-non-patch
ams = am -s
amks = am -s --keep-non-patch
fp = format-patch
purr = pull --rebase
puff = pull --ff-only
muff = merge --ff-only
munn = merge --no-ff
ready = rebase -i @{u}
ri = rebase --interactive
rc = rebase --continue
ra = rebase --abort
sp = stash pop
ss = stash
tarball = !sh -c 'git archive --format tar.gz --prefix `basename $PWD`-`git abbrev`/ HEAD > `basename $PWD`-`git abbrev`.tgz'
mlog = !sh -c \"git log $(git merge-base --octopus $(git log -1 --merges --pretty=format:%P ${1-`echo HEAD`}))..$(git log -1 --merges --pretty=format:%H ${1-`echo HEAD`}) --boundary --graph --pretty=oneline --abbrev-commit\"
# http://stackoverflow.com/a/30998048/328260
find-merge = "!sh -c 'if [ "$0" != "sh" ]; then commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2; else echo No commit passed; fi'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n "$merge" ] && git show $merge'"
[pretty]
fixes = Fixes: %h (\"%s\")
# libevent changelog
le = " o %s (%h %aN)"
[apply]
whitespace = warn
# insteadOf/pushInsteadOf
[url "git://anongit.kde.org/"]
insteadOf = kde:
[url "[email protected]:"]
pushInsteadOf = kde:
[url "[email protected]:"]
insteadOf = github:
[url "git://git.code.sf.net/p/"]
insteadOf = sf:
[url "https://anonscm.debian.org/git/collab-maint/"]
insteadOf = deb:
[url "ssh://git.debian.org/git/collab-maint/"]
pushInsteadOf = deb:
[url "https://anonscm.debian.org/users/"]
insteadOf = udeb:
[url "ssh://git.debian.org/srv/home/users/"]
pushInsteadOf = udeb:
[url "git://anongit.freedesktop.org/"]
insteadOf = freedesktop:
[url "https://aur.archlinux.org/"]
insteadOf = aur:
[url "ssh://[email protected]/"]
pushInsteadOf = aur:
[url "[email protected]:~azat/"]
insteadOf = me.sr:
[url "[email protected]:~azat/"]
pushInsteadOf = me.sr: