-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
155 lines (131 loc) · 5.73 KB
/
Copy path.gitconfig
File metadata and controls
155 lines (131 loc) · 5.73 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
143
144
145
146
147
148
149
150
151
152
153
154
155
# Git Config Reference
# - http://git-scm.com/book/en/Customizing-Git-Git-Configuration
# - https://github.com/tiimgreen/github-cheat-sheet#git-configurations
# - http://haacked.com/archive/2014/07/28/github-flow-aliases/
# Docs: `$ man git-<command>` (e.g. `$ man git-push`)
# ───────────────────────────────────────────────────────────────
# Git Config Levels
# 1) Project: `.git/config` in the project
# $ git config user.name "John Doe"
# 2) Global: `~/.gitconfig`
# $ git config --global user.name "John Doe"
# 3) System: `/etc/gitconfig`
# $ git config --system user.name "John Doe"
# ───────────────────────────────────────────────────────────────
# ─── Aliases ────────────────────────────────────────────────────
[alias]
# Add / Commit
a = add
aa = add --all
c = commit
cam = !git add --all && git commit --message
cm = commit --message
save = !git add --all && git commit -m 'SAVEPOINT'
wip = !git add --update && git commit --message="WIP"
wipe = !git add --all && git commit --quiet --message='WIPE SAVEPOINT' && git reset head~1 --hard
amend = commit --all --amend
undo = reset --mixed head~1
# Branching
br = branch
brm = branch --move
branches = branch -a
cob = checkout -b
col = checkout -
com = checkout main
comf = checkout origin/main
bclean = "!f() { git branch --merged ${1-main} | grep -v \" ${1-main}$\" | xargs -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-main} && git up && git bclean ${1-main}; }; f"
# Checkout
co = checkout
# Config Helpers
cg = config --global
cge = config --global --edit
aliases = config --get-regexp alias
# Diff / Grep / Log
df = diff
g = grep -I
lg = log --patch
lol = log --graph --oneline --date-order --decorate --color --all -n 250
loq = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
# Pull / Push
fps = !git fetch && git pull && git status
p = push
pf = push --force
pn = push --set-upstream origin head
prune = fetch --prune
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# Remotes
remotes = remote --verbose
pb = publish-branch
# Rebase / Review
rb = rbranch
rbm = rebase main
rbmi = rebase --interactive main
rv = review
# Stash / Show
sa = stash apply # apply latest stash
sp = stash pop # apply and drop latest stash
su = stash -u # stash including untracked files
sta = stash -a # stash all, including ignored files
sl = stash list # list all stashes
ss = stash show # show diff of latest stash
spm = "!f() { git stash push -u -m \"$@\"; }; f" # stash with custom message
sap = "!git stash list | fzf | cut -d: -f1 | xargs git stash apply" # fuzzy apply by title
spp = "!git stash list | fzf | cut -d: -f1 | xargs git stash pop" # fuzzy pop by title
sm = log --merges --oneline --graph --decorate
# Status / Tags
s = status
st = status --short --branch
tags = tag --list
# ─── Core Settings ──────────────────────────────────────────────
[core]
autocrlf = false
ignorecase = false
whitespace = space-before-tab,indent-with-non-tab,trailing-space
excludesfile = ~/.gitignore_global
# ─── Push Settings ──────────────────────────────────────────────
[push]
default = simple
followTags = true
# ─── Merge Settings ─────────────────────────────────────────────
[merge]
#ff = only
#log = true
#conflictstyle = diff3
# ─── Rebase Behavior ────────────────────────────────────────────
[branch]
autosetuprebase = always
# ─── Rerere ─────────────────────────────────────────────────────
[rerere]
enabled = 1
# ─── Color Settings ─────────────────────────────────────────────
[color]
ui = 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
# ─── Help Behavior ──────────────────────────────────────────────
[help]
autocorrect = 1
# ─── Git LFS ────────────────────────────────────────────────────
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
# ─── Status Behavior ────────────────────────────────────────────
[status]
showUntrackedFiles = all
# ─── Transfer Behavior ──────────────────────────────────────────
[transfer]
fsckobjects = true