-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
155 lines (119 loc) · 3.63 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
#
# File: Global git configurations
#
[github]
# see .gitconfig.local
[credential]
helper = osxkeychain
[alias]
# Change directory to repo root
repo-root = "!cd $(git rev-parse --show-cdup)"
# Display the commit history in a tree format, with color.
tree = "!git log --graph --decorate --pretty=format:'%C(yellow)%h %Cred%ad %Cblue(%an)%C(cyan)%d%Creset %s' --abbrev-commit"
recent = "!git log --color --format='format:%C(auto)%h %Cred%<(8,trunc)%aN %Cblue%<(12)%ar %Creset%s'"
# merge history
mh = "!git log --decorate=short --pretty=format:'%C(yellow) %h %C(blue) %s %C(reset)(%C(red)by %cN %C(green)on %cD%C(reset))' --merges"
# Sometimes the only change in a file is from 0755 to 0644 or
# vice versa; the following command resets all file permissions
# changes to their original values.
permission-reset = "!git diff -p | grep -E \"^(diff|old mode|new mode)\" | sed -e \"s/^old/NEW/;s/^new/old/;s/^NEW/new/\" | git apply"
# Some shortcuts.
ci = commit -a
co = checkout
up = !git remote update ; git fetch --prune; git gc
s = "!git diff --name-status | sed -e 's/^/W /' ; git diff --cached --name-status | sed -e 's/^/C /'"
st = "!f() { git ls-files --exclude-standard -t -u -s -m -d $@ | sed -e 's/C.*\t/C /' ; } ; f"
sto = st -o
stat = status
dp = diff --patience
ds = diff --stat
odiff = difftool -t opendiff
cds = !git ds --cached
fp = format-patch
# List all ignored files in a working tree.
lso = ls-files --others --exclude-standard
# Stage new/renamed/copied/deleted files when applying a patch.
apply = apply --index
# Push to the same branch name on the remote, without explicitly using --set-upstream
pushup = "!git push --set-upstream origin $(git symbolic-ref --short HEAD)"
[branch]
# Rebase when pulling avoids merge commits.
autosetuprebase = always
sort = -committerdate
[checkout]
defaultRemote = origin
[core]
editor = vim
# A global excludesfile similar to .gitignore
excludesfile = ~/.gitexcludes
pager = less -FRSX
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
quotepath = false
autocrlf = input
[color]
ui = true
pager = true
diff = auto
status = auto
branch = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[column]
# put output from commands like git branch into multiple columns.
#ui = auto
[diff]
tool = vimdiff
algorithm = patience
renames = copies
[format]
pretty = oneline
[push]
default = current
follow-tags = true
followTags = true
[pull]
rebase = true
[fetch]
prune = true
writeCommitGraph = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[merge]
tool = smerge
[log]
date = format-local:%F %k:%M:%S
[rerere]
enabled = true
[gpg]
format = ssh
[gpg "ssh"]
# Requires:
# echo "$(git config --get user.email) namespaces=\"git\" $(cat ~/.ssh/id_rsa.pub)" >> ~/.ssh/allowed_signers
allowedSignersFile = ~/.ssh/allowed_signers
[commit]
gpgsign = true
[tag]
gpgsign = true
[user]
signingKey = ~/.ssh/id_rsa.pub
[init]
#templatedir = ~/.git_template/template
defaultBranch = main
# use separate file for username / github token / etc
[include]
path = ~/.gitconfig.local