-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
136 lines (110 loc) · 3.9 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
131
132
133
134
135
136
[alias]
aliases = "!if command -v pygmentize &>/dev/null; then git config -l | grep alias | cut -c 7- | pygmentize -l ini -O style=nord; else git config -l | grep alias | cut -c 7-; fi"
amend = commit --amend
branches = branch -a
discard = checkout --
filelog = log -u # All the commits related to a file
fixup = commit --amend --no-edit
force = "!git push origin $(git mainbranch) --force-with-lease --force-if-includes"
forgot = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
mainbranch = "!git remote show origin | sed -n '/HEAD branch/s/.*: //p'"
nevermind = "!git reset --hard HEAD && git clean -d -f"
oops = commit --amend --no-edit
reb = "!r() { git rebase -i HEAD~${1:-2}; }; r"
remotes = remote -v
stashes = stash list
subup = submodule update --init --recursive
synced = "!git pull origin $(git mainbranch) --rebase" # Rebase on remote main
tags = tag -l
unadd = reset HEAD --
undo = reset --soft HEAD~1
unstage = reset HEAD --
ls = log --color --pretty=oneline -n 20 --graph --abbrev-commit
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat -n 10
lnc = log --pretty=format:"%h\\ %s\\ [%cn]" # No colors. Good for pipes
[apply]
whitespace = fix
[core]
# Use custom `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
# Treat spaces before tabs and all kinds of trailing whitespace as an error
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
# Prevent showing files whose names contain non-ASCII symbols as unversioned.
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
precomposeunicode = false
# Set default editor to use VisualCode
editor = code --wait
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = magenta bold
old = red bold
new = green bold
commit = yellow bold
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff "bin"]
# Use `hexdump` to diff binary files
textconv = hexdump -v -C
[diff]
renames = copies # Detect copies as well as renames
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[help]
autocorrect = 1
[include]
# Use separate file for username / github token / etc
path = ~/.gitconfig.local
[init]
defaultBranch = main
[log]
decorate = short
trustExitCode = true
keepBackup = true
prompt = false
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED
[pretty]
custom = "%C(magenta)%h%C(red)%d %C(yellow)%ar %C(green)%s %C(yellow)(%an)"
# │ │ │ │ └─ author
# │ │ │ └─ message
# │ │ └─ date (relative)
# │ └─ decorations (branch, heads or tags)
# └─ hash (abbreviated)
[pull]
rebase = true
[push]
default = simple
followTags = true
[pager]
status = true
show-branch = true
[rebase]
autoStash = true