/
.gitconfig
130 lines (101 loc) · 4.16 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
[include]
path = .gitconfig-private
[status]
# Show detailed submodule info when doing git status:
submoduleSummary = true
[diff]
# Detected rename and copies.
renames = copies
# Don't show a/-b/ prefixes in diffs.
noprefix = true
[merge]
# Add common ancestor data in merge conflict diffs:
conflictstyle = diff3
[push]
default = simple
[alias]
# list aliases:
la = "!git config -l | grep alias | cut -c 7-"
sh = show --submodule
st = status -sb
sta = status --untracked-files=all
stu = status -s --untracked=no
ci = commit
cia = commit --amend
br = branch
co = checkout
#df = diff --submodule
df = diff
dc = !git df --cached
dfw = !git df --word-diff
dcw = !git dc --word-diff
cp = cherry-pick
lg = log -p
fvars = fetch -va --recurse-submodules
# search for commits that change trailing argument
ps = log -p -S
fe = submodule foreach
# find file:
ff = !git ls-files | grep -i --color
# -I = no binary
gr = grep -Ii
# Remove untracked files from working tree:
# (-n) dry run, (-d) remove dirs, (-X) only files ignored by git.
ign = clean -ndX
# Nice. Git is acting very strange: There doesn't seem to be a single command
# which will actually list all ignored files, heh.
ign2 = ls-files --others --ignored --exclude-standard
#lol = log --graph --decorate --pretty=oneline --abbrev-commit
#lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
lol = log --graph --pretty=format:'%C(red bold)%h%Creset -%C(yellow bold)%d%Creset %s %C(green bold)(%ad) %C(bold cyan)<%an>%Creset' --abbrev-commit --decorate --date=iso
loll = log --graph --pretty=format:'%C(red bold)%h%Creset -%C(yellow bold)%d%Creset %s %C(green bold)(%ad) %C(bold cyan)<%an>%Creset%n%w(0,4,4)%-b%n%n%-N' --abbrev-commit --decorate --date=iso
lola = log --graph --pretty=format:'%C(red bold)%h%Creset -%C(yellow bold)%d%Creset %s %C(green bold)(%ad) %C(bold cyan)<%an>%Creset' --abbrev-commit --decorate --date=iso --all
lolla = log --graph --pretty=format:'%C(red bold)%h%Creset -%C(yellow bold)%d%Creset %s %C(green bold)(%ad) %C(bold cyan)<%an>%Creset%n%w(0,4,4)%-b%n%n%-N' --abbrev-commit --decorate --date=iso --all
hist = log --pretty=format:\"%h %ad %s%d [%an]\" --graph --date=short
timeline = log --oneline --graph --decorate
# show reflog in full log format
gg = log -g
#lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold cyan)<%an>%Creset' --abbrev-commit --date=relative
# from https://coderwall.com/p/lypuua
pdiff = !TAG=$(git describe --no-abbrev --tags --match production-*) && git df $TAG
sdiff = !TAG=$(git describe --no-abbrev --tags --match staging-*) && git df $TAG
# from geir @ work
zco = !B=`git branch | cut -b3- | fzf` && git checkout ${B}
zadd = !FILES=`git status -s | awk '{ print $2 }' | fzf -x -m` && git add --all ${FILES}
zreb = !HASH=`git log --pretty=oneline --abbrev-commit | head -n 100 | fzf` && git rebase -i `echo ${HASH} | awk '{ print $1 }'`^
zres = !HASH=`git log --pretty=oneline --abbrev-commit | head -n 50 | fzf` && git reset --soft `echo ${HASH} | awk '{ print $1 }'`^
# zld = !B=`git branch | cut -b3- | fzf` && echo master..${B} && git log --pretty=oneline --abbrev-commit master..${B}
zld = !B=`git branch | cut -b3- | fzf` && echo HEAD..${B} && git log --pretty=oneline --abbrev-commit HEAD..${B}
delete-merged-remote = !git log --oneline --decorate|grep \\(origin|awk '{ print $2 }'|sed 's/(origin\\//:/'|sed 's/)//'|fzf|xargs echo git push origin
[color]
branch = auto
diff = auto
status = auto
interactive = auto
grep = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[init]
defaultBranch = main
[core]
# rebases can often fail due to modified files that are not modified, and
# this seems to fix it:
# https://www.git-tower.com/blog/make-git-rebase-safe-on-osx/
trustctime = false
[rerere]
enabled = 1
[gc]
reflogExpire = never
worktreePruneExpire = 12.months.ago
reflogExpireUnreachable = 12.months.ago