-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitconfig
More file actions
135 lines (126 loc) · 4.25 KB
/
.gitconfig
File metadata and controls
135 lines (126 loc) · 4.25 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
[user]
name = Chris St. Pierre
email = chris.a.st.pierre@gmail.com
signingkey = BA70C55C63A66668852E270610DF5E32832981E6
[color]
diff = auto
status = auto
branch = auto
ui = auto
[alias]
a = add
ama = "amend -a"
br = branch
branch-exists = "!f() { \
git show-ref --verify --quiet refs/heads/$1; \
}; f"
ci = commit
cia = "ci -a"
co = checkout
d = diff
f = "!git fetch --all; git fetch --tags --force"
fixup = cia --amend --no-edit
fr = full-rebase
fu = fixup
full-rebase = "!f() { \
set -euo pipefail; \
branch=$(git what-branch); \
parent=${1:-$(git primary-branch)}; \
git co \"$parent\"; \
git upstream; \
git co \"$branch\"; \
git rebase \"$parent\"; \
}; f"
g = grep
h = hist
hist = "log --color --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
low = !echo '___________________ ____ __________ ____ __.\n\\_ ___ \\______ \\ | \\ \\ | |/ _|\n/ \\ \\/| _/ | / | \\| <\n\\ \\___| | \\ | / | \\ | \\\n \\______ /____|_ /______/\\____|__ /____|__ \\\n \\/ \\/ \\/ \\/\n ____.____ ___.____________ ___________\n | | | \\ \\_ ___ \\\\_ _____/\n | | | / / \\ \\/ | __)_\n/\\__| | | /| \\ \\____| \\\n\\________|______/ |___|\\______ /_______ /\n \\/ \\/'
nb = new-branch
new-branch = "!f() { \
set -euo pipefail; \
git co \"${2:-$(git primary-branch)}\"; \
git up; \
git co -b \"$1\"; \
}; f"
new-pr = "pull-request --push --no-edit --draft"
nuke = "!f() { \
set -euo pipefail; \
git up; \
git clean -dffx; \
git gc; \
}; f"
onward = "!f() { \
git fixup; \
git rc; \
}; f"
p = push
pf = "push -f"
primary-branch = "!f() { \
set -euo pipefail; \
for candidate in master main devel; do \
if git branch-exists \"$candidate\"; then \
echo \"$candidate\"; \
exit 0; \
fi; \
done; \
echo \"No primary branch found\" 1>&2; \
exit 1; \
}; f"
pu = "pull --rebase --ff-only"
pull-push = "!git pu; git p"
r = rebase
rc = "rebase --continue"
rebase-branch = "!f() { \
set -euo pipefail; \
git co \"$1\"; \
rebase-push; \
}; f"
rebase-push = "!f() { \
set -euo pipefail; \
git full-rebase \"${1:-}\"; \
git push -f; \
}; f"
rp = rebase-push
rename-branch = "!f() { \
set -euo pipefail; \
git co \"$1\"; \
git co -b \"$2\"; \
git branch -D \"$1\"; \
}; f"
review = "!f() { \
set -euo pipefail; \
branch=$(hub pr show -f%H \"$1\"); \
git diff \"$(git merge-base origin/\"$branch\" \"$(git primary-branch)\")\"..origin/\"$branch\"; \
}; f"
ri = "rebase -i"
rim = "!git rebase -i \"$(git primary-branch)\""
root = "rev-parse --show-toplevel"
rH = "reset HEAD"
s = st
sh = show
sH = show HEAD
st = status
status = "status --show-stash"
u = up
up = upstream
upstream = "!git reset --hard @{upstream}; git f; git pu"
what-branch = "!git branch --no-color 2> /dev/null | sed -e '/^[^*]/d; s/^* //;'"
wherewasi = "!git checkout \"$(git branch --sort=-committerdate --format='%(refname:short)' | fzf +m)\""
[push]
default = current
[github]
user = stpierre
[sendemail]
from = chris.a.st.pierre@gmail.com
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = chris.a.st.pierre@gmail.com
smtpserverport = 587
[gpg]
program = gpg2
[interactive]
singleKey = true
[init]
defaultBranch = main
[advice]
skippedCherryPicks = false