-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_gitconfig
More file actions
144 lines (125 loc) · 4.85 KB
/
dot_gitconfig
File metadata and controls
144 lines (125 loc) · 4.85 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
136
137
138
139
140
141
142
#
# ------------------------------------------------------------
# - title: .gitconfig
# - Author: Rakesh Niraula
# - date: 2020-04-03 09:35:59
# ------------------------------------------------------------
[user]
name = Rakesh
email = rakeshhniraulaa@gmail.com
[color]
diff = auto
status = auto
branch = auto
[color "status"]
added = green
changed = blue
untracked = red
[color "diff"]
meta = yellow
old = red
new = green
[commit]
template = ~/.gitmessage
[core]
editor = nvim
autocrlf = input
excludesfile = /Users/rakesh/.gitignore_global
pager = delta
[interactive]
diffFilter = delta --color-only
[push]
followTags = true
default = current
[merge]
conflictStyle = zdiff3
[diff]
colorMoved = default
[pull]
rebase = true
[alias]
lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(white) - %an%C(reset) %C(bold red)' --all
plog = log --graph --pretty=tformat:'%Cred%h%Creset %C(bold blue)%<(20,trunc)%an%Creset %C(auto)%d%Creset %s %Cgreen(%cr) '
# Adapted from https://blog.jez.io/cli-code-review/
# List files which have changed since BASE
# Set BASE in shell configuration or before the command
files = !git diff --name-only $(git merge-base HEAD "$BASE")
# With stat for interactive use
stat = !git diff --stat $(git merge-base HEAD "$BASE")
# with fzf logs
fzf = log --oneline --color=always | fzf --ansi --preview 'git show --color=always {1}'
# Interactive commit browser with fzf
flog = "!f() { \
git log --graph --color=always --oneline --decorate --all \"$@\" | \
fzf --ansi --no-sort --reverse --multi --tiebreak=index \
--preview \"echo {} | grep -o '[a-f0-9]\\{7,40\\}' | head -1 | xargs -I % git show --color=always % --stat\" \
--preview-window=\"right:50%\" \
--bind \"enter:execute(echo {} | grep -o '[a-f0-9]\\{7,40\\}' | head -1 | xargs -I % git show %)\" \
--bind \"ctrl-d:execute(echo {} | grep -o '[a-f0-9]\\{7,40\\}' | head -1 | xargs -I % git diff %^..%)\" \
--bind \"ctrl-f:execute(echo {} | grep -o '[a-f0-9]\\{7,40\\}' | head -1 | xargs -I % git show --name-only %)\" \
--bind \"ctrl-y:execute-silent(echo {} | grep -o '[a-f0-9]\\{7,40\\}' | head -1 | pbcopy)\" \
--header \"ENTER: show | CTRL-D: diff | CTRL-F: files | CTRL-Y: copy hash\"; \
}; f"
# Search commits by message
fsearch = "!f() { \
git log --color=always --format=\"%C(auto)%h %C(green)%ad %C(auto)%s %C(blue)%an\" --date=short --grep=\"$1\" | \
fzf --ansi --preview \"echo {} | cut -d' ' -f1 | xargs git show --color=always\"; \
}; f"
# Interactive branch selector
fbranch = "!f() { \
git branch -a --color=always | grep -v '/HEAD\\s' | \
fzf --ansi --preview \"git log --oneline --graph --date=short --color=always --pretty='format:%C(auto)%cd %h%d %s' {1} | head -20\" | \
sed 's/^..//' | sed 's#remotes/origin/##'; \
}; f"
# Put heatmap on your path:
# https://github.com/jez/git-heatmap/blob/master/git-heatmap
heatmap = git-heatmap
# Open all files changed since BASE in Vim tabs
# Then, run fugitive's :Gdiff in each tab, and finally
# tell vim-gitgutter to show +/- for changes since BASE
review = !vim -p $(git files) +"tabdo Gdiff $BASE" +"let g:gitgutter_diff_base = '$BASE'"
# Same as the above, except specify names of files as arguments,
# instead of opening all files:
# git reviewone foo.js bar.jsreviewone
reviewone = !vim -p +"tabdo Gdiff $BASE" + "let g:gitgutter_diff_base = '$BASE'"
[credential]
helper = cache
[difftool "lazygit"]
cmd = opendiff "$LOCAL" "$REMOTE"
[mergetool "lazygit"]
cmd = lazygit "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"
trustExitCode = true
[init]
defaultBranch = main
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[column]
ui = auto
[branch]
sort = -committerdate
[rerere]
enabled = true
# delta
[include]
path = ~/.config/bat/themes/catppuccin.gitconfig
; path = ~/delta-themes.gitconfig
[interactive]
diffFilter = delta --color-only
[delta]
true-color = always
features = catppuccin-macchiato decorations
; features = mirthful-willow
navigate = true # use n and N to move between diff sections
# delta detects terminal colors automatically; set one of these to disable auto-detection
# dark = true
# light = true
[delta "decorations"]
line-numbers = true
side-by-side = false
blame-format = "{commit:>7} ┊ {timestamp:^16} ┊ {author:<18} "
hyperlink = true
hyperlinks-file-link-format = "zed://file/{path}:{line}"
; hyperlinks-file-link-format = "idea://open?file={path}&line={line}"