-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
91 lines (69 loc) · 2.09 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
[color]
ui = auto
[color "branch"]
current = yellow
local = green
remote = cyan
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[alias]
# shortcut to list all aliases for git
la = !git config -l | grep alias | cut -c 7-
# aliases for the most common commands
br = branch
co = checkout
ci = commit
s = status -s -uno
st = status
# alias to fix the last commit without changing the commit message
caan = commit --all --amend --no-edit
# alias to undo the last commit and leave the files staged
undo = reset --soft HEAD^
# alias to remove untracked and ignored files
cleanup = clean -fdx
# alias to list contributors sorted by commit count
contrib = shortlog --summary --numbered
# aliases to provide different views of the commit log
one = show -1
ten = log -10 --pretty=short --stat
cached = diff --cached
ls = log --pretty=format:'%C(yellow)%h %C(red)%d %C(reset)%s %C(cyan)(%cr) %C(blue)[%cn]'
ll = log --pretty=format:'%C(yellow)%h %C(red)%d %C(reset)%s %C(cyan)(%cr) %C(blue)[%cn]' --numstat
lg = log --pretty=format:'%C(yellow)%h %C(red)%d %C(reset)%s %C(cyan)(%cr) %C(blue)[%cn]' --graph
# alias to show the current branch
current = branch --show-current
# alias to show the root directory
root = rev-parse --show-toplevel
# alias to edit the global gitconfig
edit = config --global -e
# alias to configure local branch to origin repository
push-origin = push -u origin
# alias to prune local copies of remote branches that no longer exist
prune-origin = remote prune origin
# aliases to improve submodule UX
submodule-sync = submodule sync --recursive
submodule-update = submodule update --init --recursive
# aliases to flag files that are not in .gitignore
index-flag = update-index --assume-unchanged
index-unflag = update-index --no-assume-unchanged
[grep]
lineNumber = true
patternType = extended
[pull]
rebase = true
[push]
default = simple
followTags = true
autoSetupRemote = true
[core]
autocrlf = input
editor = nvim
[init]
defaultBranch = main