-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.gitconfig
More file actions
125 lines (104 loc) · 3.48 KB
/
.gitconfig
File metadata and controls
125 lines (104 loc) · 3.48 KB
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
# vim: set noexpandtab:
[user]
email = kfunk@kde.org
name = Kevin Funk
[diff "docx"]
binary = true
textconv = ~/bin/docx2txt-for-git.sh
[diff "odf"]
textconv = odt2txt
[merge]
tool = kdiff3
guitool = kdiff3
[commit]
template = ~/.commit-template
status = on
[alias]
b = checkout -b
c = checkout
ct = checkout --track
coam = commit --amend
coup = commit --amend --no-edit
d = diff --exit-code
dt = difftool --dir-diff
wdiff = diff --color-words
f = fetch --all
i = rebase -i
l = l-nograph --graph
l-nograph = log \
--pretty=format:'%C(yellow)%h%Creset -%C(red)%d%Creset %s %C(green)(%cr)%Creset %C(bold blue)<%an>%Creset' \
--abbrev-commit --date=relative
# List most recently used branches -- from http://ses4j.github.io/2020/04/01/git-alias-recent-branches/
lb = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 10 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}'
lo = log -u --stat
r = pull --rebase
# https://stackoverflow.com/questions/17369254/is-there-a-way-to-cause-git-reflog-to-show-a-date-alongside-each-entry
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
rr = pull --rebase --recurse-submodules
sw = switch
# https://stackoverflow.com/questions/1657017/how-to-squash-all-git-commits-into-one
squash-all = "!f(){ git reset $(git commit-tree HEAD^{tree} \"$@\");};f"
stuno = status -uno
sur = submodule update --recursive
up = !git fetch --all && git stash && git pull --rebase && git stash pop
pushall = !git remote | xargs -n1 git push
pushalltags = !git remote | xargs -n1 git push --tags
prunetags = !git tag -l | xargs git tag -d && git fetch -t
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"
edit-last-commit = !vim `git diff-tree -r --name-only HEAD HEAD~1`
print-unreachable-commits = "!git fsck --no-reflogs --unreachable | awk '{if ($2 == \"commit\") print $3}'"
# post-review = !post-review -o --guess-summary --guess-description
post-review = rebase -i -x \"arc diff --head HEAD HEAD~1 && arc amend\"
outgoing = log @{u}..
incoming = log ..@{u}
reset-to-upstream = reset --hard @{upstream}
# more aliases: http://www.jukie.net/~bart/conf/gitconfig
# URL rewrites
[url "https://invent.kde.org/"]
insteadOf = kde:
[url "git@github.com:"]
insteadOf = "github:"
[url "git@github.com:"]
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
pushInsteadOf = "https://github.com/"
[url "https://gitlab.com/"]
insteadOf = "gitlab:"
[url "git@gitlab.com:"]
pushInsteadOf = "gitlab:"
pushInsteadOf = "https://gitlab.com/"
[url "git@gitorious.org:"]
pushInsteadOf = git://gitorious.org/
[url "ssh://krf@codereview.qt-project.org:29418/"]
insteadOf = "qt:"
[rebase]
autostash = true
stat = true
[include]
path = ~/.gitconfig-private
[rerere]
enabled = false
[init]
templatedir = ~/.git-templates
[core]
pager = perl /usr/share/doc/git/contrib/diff-highlight/diff-highlight | less -F
attributesfile = ~/.gitattributes_global
[merge "ours"]
driver = true
[am]
threeWay = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[push]
default = current
autoSetupRemote = true
[credential]
helper = store
[pull]
rebase = true
[url "ssh://git@invent.kde.org/"]
pushInsteadOf = kde: