-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
138 lines (103 loc) · 4.7 KB
/
.gitconfig
File metadata and controls
138 lines (103 loc) · 4.7 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
126
127
128
129
130
131
132
133
134
135
136
137
138
[user]
name = Pierre Beitz
email = pierrebeitz@gmail.com
signingkey = BF42E941C3D542238A60BD0A74D41F4238D84443
[core]
excludesfile = ~/.global_gitignore # a global gitignore!
ignorecase = false
pager = diff-so-fancy | less --tabs=4 -RFX
whitespace = trailing-space,space-before-tab # Show whitespace-issues on git diff
commentChar = ";"
[github]
user = pierrebeitz
[alias]
a = add -u # -u: also move removed files to index
aa = add --all :/ # add all files project-wide
ap = add -u -p # -p: add hunks interactively one by one
# branches: delete merged. convenience to clean up local branches
bdm = !git branch --merged | grep -v '*' | xargs -n 1 git branch -d
# verbose: show a complete diff below the usual commit message buffer
c = commit
cf = commit --fixup
# show a word-comparing diff
df = diff --color --color-words --abbrev
l = !. ~/.githelpers && pretty_git_log # show a pretty log
la = !git l --all # ... of all branches
lme = !git l --all --author='Pierre' --date-order # ... of only my commits
r = !GIT_NO_PAGER=1 git l -30 # of recent (30) commits
ra = !git r --all # of recent commits on all branches
# remove specified branch here and on origin
nuke = !sh -c 'git branch -d $1 && git push origin :$1' -
search = log -G
dsearch = log -p -G
po = pull origin
pu = push -u origin
# force push if nobody else changed stuff yet
pf = push --force-with-lease
dmerged = !git checkout master && git branch --merged | grep -v master | xargs -n1 git branch -d
# list authors by # of commits
rank = shortlog -sn --no-merges
delete-branches = "!r() { refbranch=$1 count=$2; git for-each-ref --sort=-committerdate refs/heads --format='%(refname:short)|%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' --color=always --count=${count:-20} | while read line; do branch=$(echo \"$line\" | awk 'BEGIN { FS = \"|\" }; { print $1 }' | tr -d '*'); colorline=$(echo \"$line\" | sed 's/^[^|]*|//'); echo \"$colorline\" | awk -F'|' -vOFS='|' '{$5=substr($5,1,70)}1' ; done | column -ts'|' | fzf --ansi -m | tr -s ' ' | cut -d' ' -f2 | xargs -n1 git branch -D; }; r"
rebaseAll = !~/.rebase_all.sh
# recently changed branches
recent = "!r() { refbranch=$1 count=$2; git for-each-ref --sort=-committerdate refs/heads --format='%(refname:short)|%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' --color=always --count=${count:-20} | while read line; do branch=$(echo \"$line\" | awk 'BEGIN { FS = \"|\" }; { print $1 }' | tr -d '*'); colorline=$(echo \"$line\" | sed 's/^[^|]*|//'); echo \"$colorline\" | awk -F'|' -vOFS='|' '{$5=substr($5,1,70)}1' ; done | column -ts'|' | fzf --ansi | tr -s ' ' | cut -d' ' -f2 | xargs -n1 git checkout; }; r"
repull = !git fetch && git reset --hard origin/`git rev-parse --abbrev-ref HEAD`
rbm = !git fetch && git rebase -i origin/master
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = !git ls-files -v | grep ^h | cut -c 3-
unassumeall = !git assumed | xargs git update-index --no-assume-unchanged
assumeall = !git st -s | awk {'print $2'} | xargs git assume
t = !sh -c 'git log --pretty=format:\"%h %ad %s\" --date=iso --reverse \"$1\" | tac | fzf --preview=\"git show {1}:\\\"$1\\\" | bat --style=numbers,changes --color=always\" --preview-window=right:70%' -
[branch]
# imply the --track option.
autosetupmerge = always
# http://stackoverflow.com/a/22147540/1242725
autosetuprebase = always
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = magenta bold
old = red bold
new = green bold
commit = yellow bold
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff]
# Whether and how Git detects renames. If set to "copies", Git will detect copies, as well.
renames = copies
tool = vimdiff
[fetch]
# delete untouched branches that have been remotely removed
prune = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[pull]
rebase = true
[push]
# in centralized workflow, work like upstream with an added safety to refuse to
# push if the upstream branch’s name is different from the local one.
default = current
[rebase]
autosquash = true
autoStash = true
[rerere]
enabled = true
[init]
defaultBranch = main