-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
101 lines (89 loc) · 3.11 KB
/
.gitconfig
File metadata and controls
101 lines (89 loc) · 3.11 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
# core stuff
[init]
defaultBranch = main
[pull]
ff = only
[push]
autoSetupRemote = true
[commit]
gpgsign = false
verbose = true
[gc]
autoDetach = false
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[core]
editor = nvim
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
features = decorations
line-numbers = true
diff-so-fancy = true
navigate = true
[merge]
tool = meld
[mergetool "meld"]
cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED" --auto-merge
;cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
# explanation: https://stackoverflow.com/a/79488890
# let git auto-resolve as much as possible, overwrites $LOCAL and $REMOTE accordingly
; hideResolved = true
# let meld auto-resolve as much as possible, does not overwrite $LOCAL and $REMOTE
# NOTE: does not work when mergetool.meld.cmd is used as well -> set as cmdline option there
; useAutoMerge = true
[diff]
# https://difftastic.wilfred.me.uk/git.html
# make difft default; opt-out with --no-ext-diff
; external = difft
tool = meld
colorMoved = default
[diff "sopsdiffer"]
textconv = sops decrypt
[difftool]
prompt = true
[difftool "meld"]
cmd = meld "$LOCAL" "$REMOTE"
[difftool "diffpdf"]
# usage: git difftool --tool=diffpdf file.pdf
cmd = diffpdf --view "$LOCAL" "$REMOTE"
# useful aliases
[alias]
st = status
co = checkout
br = branch
sw = switch
com = commit
root = rev-parse --show-toplevel
uncommit = reset --soft HEAD~
unstage = reset HEAD --
difft = -c diff.external=difft diff
# re-applying same commit msg after a `git uncommit`
commit--reuse-after-uncommit = commit --reuse-message=ORIG_HEAD
commit--reuse-after-failed = "!git commit -F $(git root)/.git/COMMIT_EDITMSG"
# mimic glg alias
lg = log --date-order --graph --pretty=format:'%C(bold yellow)%h%C(reset) %s%C(auto)%d%C(reset)'
lg0 = log --graph --abbrev-commit --all
# https://stackoverflow.com/a/34467298
lg1 = lg1-specific --all
lg2 = lg2-specific --all
lg3 = lg3-specific --all
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) [%G?] - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) [%G?] - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) [%G?] - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
# https://stackoverflow.com/a/14969986
pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
# local user.name|.email|.signingkey
[include]
path = ~/.gitconfig.d/local