-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
81 lines (73 loc) · 3.12 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
# reference to [[https://github.com/jessfraz/dotfiles/blob/master/.gitconfig|dotfiles/.gitconfig at master · jessfraz/dotfiles]]
[core]
editor = nvim
# display UTF-8 encoded chars
# https://stackoverflow.com/questions/22827239/how-to-make-git-properly-display-utf-8-encoded-pathnames-in-the-console-window
quotepath = false
[pull]
rebase = true
[include]
path = ~/.gitconfig.local
[alias]
co = checkout
br = branch
ci = commit
st = status -sb
r = remote
# Show verbose output about tags, branches or remotes
ltg = tag -l
lbr = branch -a
lrv = remote -v
# Show the diff between the latest commit and the current state
ds = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
d = diff
lcg = config --global -l # show all git global configs
# Pull in remote changes for the current repository and all its submodules
p = !"git pull; git submodule foreach git pull origin master"
# pull, push and fetch
pl = pull
ps = push
f = fetch
m = merge
# Clone a repository including all submodules
c = clone --recursive
# show all aliases, from trevor bramble https://twitter.com/TrevorBramble/status/774292970681937920
lal=!git config -l | grep ^alias | cut -c 7- | sort
last = log -1 HEAD --stat # show last commit
lg = lg1 # show log graph
lg1 = lg1-specific --all
lg2 = lg2-specific --all
lg3 = lg3-specific --all
# one line per commit
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
# two lines per commit
lg2-specific = 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(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
# three lines per commit
lg3-specific = 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 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)'
# neovim as difftool: [[https://oozou.com/til/use-neovim-as-a-git-difftool-57|Use Neovim as a git difftool | OOZOU]]
[difftool]
prompt = false
[diff]
tool = nvimdiff
[difftool "nvimdiff"]
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
[mergetool]
keepTemporaries = false
keepBackup = false
prompt = false
[init]
defaultBranch = main
[diff "lockb"]
textconv = bun
binary = true
[diff "jupyternotebook"]
command = git-nbdiffdriver diff
[merge "jupyternotebook"]
driver = git-nbmergedriver merge %O %A %B %L %P
name = jupyter notebook merge driver
[difftool "nbdime"]
cmd = git-nbdifftool diff \"$LOCAL\" \"$REMOTE\" \"$BASE\"
[mergetool "nbdime"]
cmd = git-nbmergetool merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"