-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
81 lines (67 loc) · 3.86 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
[init]
defaultBranch = main
[user]
name = Jeroen Thora
email = [email protected]
signingkey = 6875186A15599DA9
[core]
fileMode = false
excludesfile = ~/.gitignore
[commit]
gpgsign = true
[gpg]
# program = gpg2
program = gpg
[merge]
log = true
[tag]
sort = version:refname
[alias]
sw = !legit switch
branches = !legit branches
graft = !legit graft \"$@\"
harvest = !legit harvest \"$@\"
publish = !legit publish
unpublish = !legit unpublish
sprout = !legit sprout \"$@\"
sync = !legit sync
resync = !legit resync
undo = !legit undo
# Quick apply a patch from a url source
quick-apply = "!f() { curl $1 | git apply -v; }; f"
# Just for brevity
stat = status
remotes = remote -v
staged = diff --staged
# Add a file/directory to your .gitignore
ignore = "!f() { echo \"$1\" >> .gitignore; }; f"
# Staging
stage = add --all
stage-patch = add --all -p
unstage = reset HEAD
# Make amending first-class
# Amend the currently staged files to the latest commit
amend = commit --amend --reuse-message=HEAD
amend-author = commit --amend -C HEAD --author
amf = !git commit --amend --no-edit && git push origin HEAD -f
hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) <%an> [%G?]%Creset'
tags = tag -n1 -l
today = log --since=\"1 day ago\" --author=\"`git config user.name`\" --pretty=oneline
standup-simple = !git log --branches --remotes --tags --no-merges --author=\"`git config user.name`\" --since="$(if [[ "Mon" == "$(date +%a)" ]]; then echo \"last friday\"; else echo \"yesterday\"; fi)" --format=%s
standup = !git log --branches --remotes --tags --no-merges --author=\"`git config user.name`\" --since=\"`$(if [[ "Mon" == "$(date +%a)" ]]; then echo \"last friday\"; else echo \"yesterday\"; fi)`\" --format=\"%Cred%h%Creset - %s %Cgreen(%cd) %C(bold blue)<%an>%Creset\"
lazy-standup = !git standup-simple | spd-say -e
# List contributors with number of commits
contributors = shortlog --summary --numbered
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
# Reset filemode changes
permission-reset = !git diff -p -R --no-color | grep -E \"^(diff|(old|new) mode)\" --color=never | git apply
ignore = "!f() { echo \\\"$1\\\" >> .gitignore; }; f"
ignore = "!f() { echo $1 >> .gitignore; }; f"
st = status -sb
# Sometimes, when you do lots of rebasing/squashing, your git directory becomes very heavy.
# With this command, git automatically removes any orphan blob in the .git/ directory.
# Tested and approved! For a very often rebased repo, turned it from 4.8GB to 350MB... 😉
gcall = -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now gc --aggressive
standup-fix = "!git log --branches --remotes --tags --no-merges --author=\"$(git config user.name)\" --since=\"if [[ \\\"Mon\\\" == \\\"$(date +%a)\\\" ]]; then echo \\\"last friday\\\"; else echo \\\"yesterday\\\"; fi\" --format=%s"
standup-fix2 = "git push origin HEAD -f log --branches --remotes --tags --no-merges --author=\"Jeroen Thora\" --since=\"if [[ \\\"Mon\\\" == \\\"Mon\\\" ]]; then echo \\\"last friday\\\"; else echo \\\"yesterday\\\"; fi\" --format=%s"
standup = "!git log --branches --remotes --tags --no-merges --author=\"`git config user.name`\" --since=\"$(if [[ \"Mon\" == \"$(date +%a)\" ]]; then echo \\\"last friday\\\"; else echo \\\"yesterday\\\"; fi)\" --format=%s"