1
+ [alias]
2
+ c = commit -am
3
+ up = pull
4
+ p = push
5
+ s = status
6
+ co = checkout
7
+ cp = cherry-pick
8
+ df = diff --color --color-words --abbrev
9
+ l = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
10
+
11
+ # Show the diff between the latest commit and the current state
12
+ d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
13
+
14
+ # See https://johnblackbourn.com/git-changelog-generator
15
+ changelog = "!_() { t=$(git describe --abbrev=0 --tags); git log ${t}..HEAD --no-merges --pretty=format:'* %s'; }; _"
16
+
17
+ # Save patch file to Desktop
18
+ patch = "!f() { \
19
+ git add . && git diff --cached > ~/Desktop/$1.diff; \
20
+ }; f"
21
+
22
+ # Find commits by source code.
23
+ cc = "!f() { \
24
+ git log --pretty=custom --decorate --date=short -S\"$1\"; \
25
+ }; f"
26
+
27
+ # Find commits by commit message.
28
+ cm = "!f() { \
29
+ git log --pretty=custom --decorate --date=short --grep=\"$1\"; \
30
+ }; f"
31
+
32
+ # Remove the tag with the specified tag name if exists and tag the latest commit with that name.
33
+ retag = "!f() { \
34
+ git tag -d "$1" &> /dev/null; \
35
+ git tag $1; \
36
+ }; f"
37
+ [color]
38
+ ui = always
39
+
40
+ [color "diff"]
41
+ meta = yellow bold
42
+ commit = green bold
43
+ frag = magenta bold
44
+ old = red bold
45
+ new = green bold
46
+ whitespace = red reverse
47
+
48
+ [color "diff-highlight"]
49
+ oldNormal = red bold
50
+ oldHighlight = "red bold 52"
51
+ newNormal = "green bold"
52
+ newHighlight = "green bold 22"
53
+
54
+ [color "branch"]
55
+ current = yellow reverse
56
+ local = yellow
57
+ remote = green
58
+
59
+ [color "status"]
60
+ added = yellow
61
+ changed = green
62
+ untracked = cyan
63
+
64
+ [commit]
65
+ gpgsign = true
66
+
67
+ [core]
68
+ attributesfile = ~/.gitattributes
69
+ excludesfile = ~/.gitignore
70
+ autocrlf = false
71
+ editor = nano
72
+ pager = diff-so-fancy | less --tabs=4 -RFX
73
+
74
+ [diff]
75
+ noprefix = true
76
+ mnemonicprefix = false
77
+ compactionHeuristic = true
78
+ tool = p4mergetool
79
+
80
+ [difftool "p4mergetool"]
81
+ cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge $LOCAL $REMOTE
82
+
83
+ [fetch]
84
+ prune = true
85
+
86
+ [gpg]
87
+ program = /usr/local/bin/gpg_wrap
88
+
89
+ [help]
90
+ # correct typos
91
+ autocorrect = 1
92
+
93
+ [merge]
94
+ tool = p4mergetool
95
+
96
+ [mergetool "p4mergetool"]
97
+ cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge $PWD/$BASE $PWD/$REMOTE $PWD/$LOCAL $PWD/$MERGED
98
+ trustExitCode = false
99
+
100
+ [mergetool]
101
+ keepBackup = false
102
+
103
+ [pretty]
104
+ custom = "%C(magenta)%h%C(red)%d %C(yellow)%ar %C(green)%s %C(yellow)(%an)"
105
+ # │ │ │ │ └─ author name
106
+ # │ │ │ └─ message
107
+ # │ │ └─ date (relative)
108
+ # │ └─ decorations (branch, heads or tags)
109
+ # └─ hash (abbreviated)
110
+
111
+ [push]
112
+ # push easily. http://stackoverflow.com/a/23918418/89484
113
+ default = current
114
+ followTags = true
115
+
116
+ [rebase]
117
+ autostash = true
118
+
119
+ [stash]
120
+ showPatch = true
121
+
122
+ [user]
123
+ # Don't guess the user's identity.
124
+ # https://github.com/git/git/blob/90f7b16b3adc78d4bbabbd426fb69aa78c714f71/Documentation/config.txt#L2847-L2855
125
+ useConfigOnly = true
126
+
127
+ [include]
128
+ # use separate file for username / github token / etc.
129
+ # at the end so it can override any of the above configs
130
+ path = ~/.gitconfig.local
0 commit comments