-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitconfig
127 lines (124 loc) · 4.32 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
[color]
ui = auto
[alias]
; simple aliases
aa = add --all
all = !git add --all --verbose | sed -e 's/^add \\(.*\\)$/\\1: taken/'
amend = commit --amend
b = branch --list -vv
changed-files = diff --name-only
ci = commit
co = checkout
dc = diff --cached
dh1 = diff HEAD~1
di = diff
ds = diff --stat=160,120
fa = fetch --all
ff = merge --ff-only
last-commit = log -1 -p
ls = ls-files
merged = branch --merged
noff = merge --no-ff
p = push -u origin HEAD
pullff = pull --ff-only
remix = rebase -i --autosquash
st = status
unadd = reset HEAD
e = experiment
root = rev-parse --show-toplevel
untracked = ls-files --others --exclude-standard *
un = untracked
; custom commands and workflows
absorb = "!f() { git ff $1 && git branch -d $f }; f"
uncommit = !git reset HEAD~1
apply-stash = "!f() { git stash apply stash@{/$*}; }; f"
current-branch=rev-parse --abbrev-ref HEAD
did = !git fetch && git divergence-count origin/develop
dim = !git fetch && git divergence-count origin/master
div = divergence
div-count = divergence-count
divc = divergence-count
files = diff HEAD --name-only
bfiles = branch-files
branch-files = !git diff `git branched-from` --name-only
branched-from = !git log --format="%d" | sed '/^$/d' | head -2 | tail -1 | cut -d ',' -f 1 | sed 's/^ (//'
cfiles = commit-files
commit-files = diff HEAD~1 --name-only
edit-branch-commits = !git rebase -i `git outgoing master | tail -1 | xargs git log --format="%P" -1`
fb = create-feature-branch
gn = goodness
gnc = goodness --cached
h = !git head
head = !git l -1
hp = "!show_git_head"
l = "!pretty_git_log -500"
le = !git l --format='%n%n%Cgreen%s%Creset%n%n%n%b%n%CblueAUTHOR%x20%aN%x20<%aE>%n%H%n'
la = !git l --all
lae = !git l --all --format='%n%n%Cgreen%s%Creset%n%n%n%b%n%CblueAUTHOR%x20%aN%x20<%aE>%n%H%n'
lms = !git local-master-sync-check
r = !git l -10
re = !git r --format='%n%n%Cgreen%s%Creset%n%n%n%b%n%CblueAUTHOR%x20%aN%x20<%aE>%n%H%n'
ra = !git r --all
rae = !git r --all --format='%n%n%Cgreen%s%Creset%n%n%n%b%n%CblueAUTHOR%x20%aN%x20<%aE>%n%H%n'
recent-branches = !git reflog --since '2 weeks ago' | grep checkout | grep -o 'moving from .*' | sed -e 's/moving from //' -e 's/.* to //' | sort | uniq
s = !git fetch && git status
show-stash = "!f() { git stash show stash@{/$*} -p; }; f"
snapshot = !git stash save --include-untracked "snapshot: $(date)" && git stash apply "stash@{0}"
ss = local-to-remote-status
dip = "!f() { git add --all && git commit -m \"$(date)\"; }; f"
wip = "!f() { git add --all && git commit -m \"✏ $*\"; }; f"
qip = "!f() { git add --all && git commit -m \"$*\"; }; f"
wipp = "!f() { git commit -m \"✏ $*\"; }; f"
cdroot = !cd `git root`
gomain = !git checkout main && git fetch && git reset --hard origin/main && git r
; gh commands
pr-approve = !gh pr review --approve
pr-checkout = "!f() { gh pr checkout \"$*\" && git r; }; f"
pra = pr-approve
prc = pr-checkout
prl = pr-list
prr = pr-rebase
; data analysis
authors = !git log --format="%aN"
email-domains = !git log --format="%aE" | awk -F'@' '{print $2}'
emails = !git log --format="%aE"
one-week = !git diff --stat `git log --since='1 week' --format=%H | tail -1`
ranked-authors = !git authors | sort | uniq -c | sort -n
ranked-email-domains = !git email-domains | sort | uniq -c | sort -n
unique-authors = !git authors | sort -u
unique-email-domains = !git email-domains | sort -u
praise = blame
[merge]
tool = vimdiff
conflictstyle = diff3
[core]
pager = less -FRX
excludesfile = ~/.gitignore_global
fsmonitor = true
untrackedCache = true
[push]
default = simple
[advice]
statusHints = false
[diff]
mnemonicprefix = true
algorithm = patience
[format]
subjectprefix = git
[rerere]
enabled = 0
[status]
showUntrackedFiles = all
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[include]
path = ~/.gitconfig-user
[includeIf "gitdir:~/work/"]
path = ~/.gitconfig-work
[url "git@github.com:"]
insteadOf = https://github.com/
[init]
defaultBranch = main