-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
98 lines (94 loc) · 3.41 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
[init]
defaultBranch = main
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[include]
path = .gitconfig.local
[core]
#editor = code --wait
excludesfile = .gitignore-global
pager = git delta
[interactive]
diffFilter = git delta --color-only
[pull]
ff = only
[merge]
ff = false
[push]
default = simple
[gc]
autoDetach = false
[alias]
delta = "!f() { if [ \"$(command -v delta)\" ]; then delta --max-line-length ${DELTA_MAX_LINE_LENGTH:-512} \"$@\"; else less \"$@\"; fi; }; f"
user = "!user=\"^x3ro\" && email=\"[email protected]\" && echo \"Setting git identity to:\n ${user} <${email}>\" && git config user.name \"^x3ro\" && git config user.email \"[email protected]\""
initial = "commit --allow-empty -m \"🦄 Initial commit.\""
new = "!if git rev-parse --git-dir &>/dev/null; then echo \"Git repo already initialized in: ${PWD}/.git/\"; exit; fi; git init && echo '' && git user && echo '' && git initial"
tree = log --date=iso --graph --pretty=\"format:%C(yellow)%<(7)%h%C(reset)%x09%ad%C(reset) %C(blue)%<(15)%an%C(reset) %C(bold yellow)%d%C(reset) %C(green)%s%C(reset)\"
tree-all = tree --exclude refs/stash --all
tree-unreferenced = log --walk-reflogs
staged = diff --staged
co = checkout
st = status
br = branch
cm = commit -m
ca = commit --amend
amend = commit --amend
sub = subrepo
sub-st = sub status
sdiff = diff --staged
a = add
unstage = restore --staged
u = unstage
unadd = unstage
ua = unadd
pop = stash pop
# === Emoji Log ===
# NEW.
cnew = "!f() { git commit -e -m \"📦 NEW: $@\"; }; f"
# IMPROVE.
cimp = "!f() { git commit -e -m \"👌 IMPROVE: $@\"; }; f"
# FIX.
cfix = "!f() { git commit -e -m \"🐛 FIX: $@\"; }; f"
# RELEASE.
crlz = "!f() { git commit -e -m \"🚀 RELEASE: $@\"; }; f"
# DOC.
cdoc = "!f() { git commit -e -m \"📖 DOC: $@\"; }; f"
# TEST.
ctst = "!f() { git commit -e -m \"🤖 TEST: $@\"; }; f"
# BREAKING CHANGE.
cbrk = "!f() { git commit -e -m \"‼️ BREAKING: $@\"; }; f"
# WIP.
cwip = "!f() { git commit -e -m \"🚧 WIP: $@\"; }; f"
stash-unstaged = "!f() { \
if $(git diff --quiet --cached --exit-code); then \
git stash \"$@\"; return; fi ;\
branch=$(git rev-parse --abbrev-ref HEAD) &&\
id=$(git rev-parse HEAD) &&\
git switch --quiet --detach $id &&\
git commit --quiet --no-verify -m 'TEMP: for stashing unstaged' &&\
id=$(git rev-parse HEAD) &&\
git switch --quiet \"$branch\" &&\
git stash push \"$@\" &&\
git switch --quiet --detach $id &&\
git reset --quiet --soft \"$branch\" &&\
git switch --quiet \"$branch\" ;\
}; f"
stash-staged = "!f() { \
if $(git diff --quiet --cached --exit-code); then \
echo >&2 'No staged changes to save'; return; fi ;\
git stash push --quiet --keep-index -m 'TEMP: for stashing staged' &&\
git stash push \"$@\" &&\
git stash pop --quiet stash@{1} &&\
git stash show -p | git apply -R ;\
}; f"
stash-apply-staged = "stash apply --index"
stash-pop-staged = "stash pop --index"
[delta]
side-by-side = false
line-numbers = true
navigate = true # Use 'n' and 'N' to move between diff sections
[safe]
directory = /etc/nixos