-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
115 lines (105 loc) · 4.65 KB
/
.gitconfig
File metadata and controls
115 lines (105 loc) · 4.65 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
[core]
editor = nano
pager = delta
excludesFile = ~/.gitignore
[init]
defaultBranch = main
[pull]
rebase = true
[format]
pretty = fuller
[alias]
a = add
au = add -u
ap = add -p
s = status
sa = status --untracked-files=all
sh = show HEAD
d = diff
ds = diff --staged
dst = diff --stat
dsst = diff --staged --stat
dlc = diff HEAD~1 HEAD
c = commit
cm = commit -m
ca = commit --amend
cam = commit --amend -m
can = commit --amend --no-edit
# Set author date to now
cad = commit --amend --date=now
camd = commit --amend -m --date=now
cand = commit --amend --no-edit --date=now
co = checkout
cob = checkout -b
pf = push --force-with-lease
rbi = rebase -i
rbir = rebase -i --root
rc = rebase --continue
# Keep committer and author date while rebasing
keepd = "!f() { git -c rebase.instructionFormat='%s%nexec GIT_COMMITTER_DATE=\"%cD\" GIT_AUTHOR_DATE=\"%aD\" git commit --amend --no-edit' \"$@\"; }; f"
# Additionally keep committer name and committer email
keepdne = "!f() { git -c rebase.instructionFormat='%s%nexec GIT_COMMITTER_DATE=\"%cD\" GIT_AUTHOR_DATE=\"%aD\" GIT_COMMITTER_NAME=\"%cn\" GIT_COMMITTER_EMAIL=\"%ce\" git commit --amend --no-edit' \"$@\"; }; f"
# Exclude files/directories while diffing: git de <ref1> <ref> [exclude...]
de = "!f() { if [[ $1 == *\"..\"* ]]; then commits=\"$1\"; index=2; else commits=\"$1..$2\"; index=3; fi; cmd=\"git diff $commits -- .\"; for i in \"${@:$index}\"; do cmd+=\" ':!$i'\"; done; bash -c \"$cmd\"; }; f"
# Instead show diff statistics while excluding files/directories
des = "!f() { if [[ $1 == *\"..\"* ]]; then commits=\"$1\"; index=2; else commits=\"$1..$2\"; index=3; fi; cmd=\"git diff $commits --stat -- .\"; for i in \"${@:$index}\"; do cmd+=\" ':!$i'\"; done; bash -c \"$cmd\"; }; f"
# Short log
l = log --decorate --graph --date=short --pretty=\"format:%C(blue)%ad%C(reset) %h %C(green)%an %C(reset)%s\"
# Full log
ll = log
# With relative dates
lr = log --decorate --graph --date=short --pretty=\"format:%C(blue)%ar%C(reset) %h %C(green)%an %C(reset)%s\"
# With branch references
lref = log --decorate --graph --date=short --pretty=\"format:%C(blue)%ad%C(reset) %h %C(magenta)%an%C(green)%d%C(reset) %s\"
# With relative dates and branch references
lrref = log --decorate --graph --date=short --pretty=\"format:%C(blue)%ad%C(reset) %h %C(magenta)%an%C(green)%d%C(reset) %s %C(blue)[%ar]\"
# Log with diff
ld = log -p
# Log with changed file stats
ls = log --stat
# Plain commits without graph
cplain = log --pretty=format:\"%h %cr %cn %C(green)%s%C(reset)\"
# Changed files for each commit
cfiles = log --pretty=format:\"%h %cr %cn %C(green)%s%C(reset)\" --name-status
# Show only commit messages
cdesc = log --pretty=format:\" * %s\"
b = branch --sort=-committerdate --sort=-HEAD --format='%(HEAD) %(if:equals=*)%(HEAD)%(then)%(color:green)%(end)%(refname:short)'
ba = branch -a
bc = branch --show-current
be = switch --orphan
br = branch -m
bd = branch -d
bupstream = branch --sort=-upstream --sort=-HEAD --format='%(HEAD) %(if:equals=*)%(HEAD)%(then)%(color:green)%(end)%(refname:short)%(color:reset) %(if:notequals=)%(upstream)%(then)[%(color:blue)%(upstream:short)%(color:reset)]%(end)'
brecent = !script -efq -O /dev/null -c \"git branch --sort=-HEAD --sort=-committerdate --format='%(HEAD) %(if:equals=*)%(HEAD)%(then)%(color:green)%(end)%(refname:short)%(color:reset)%(committerdate:relative)%(authorname)%(objectname:short)%(contents:subject)'\" | column -t -s ""
rank = shortlog -sn --no-merges
whois = "!bash -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
root = rev-parse --show-toplevel
gh-pr = "!f() { git fetch origin \"pull/$1/head:pr-$1\" && git checkout \"pr-$1\"; }; f"
[merge]
summary = true
verbosity = 1
tool = kdiff3
[delta]
features = side-by-side line-numbers decorations
syntax-theme = Dracula
plus-style = syntax "#003800"
minus-style = syntax "#3f0001"
navigate = true
wrap-max-lines = unlimited
wrap-right-percent = 15
line-fill-method = spaces
tabs = 4
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
hunk-header-decoration-style = cyan box ul
[delta "line-numbers"]
line-numbers-left-style = cyan
line-numbers-right-style = cyan
line-numbers-minus-style = 124
line-numbers-plus-style = 28
[interactive]
diffFilter = delta --color-only
[sequence]
editor = interactive-rebase-tool