-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
103 lines (81 loc) · 2.81 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
[include]
path = /home/sami/.config/delta/themes.gitconfig
[user]
name = Sami Suleiman
email = [email protected]
projects = /home/sami/medina/projs
[alias]
recent = "!f() { count=${1-10}; git for-each-ref --count=$count --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' --color=always|column -ts'|'; }; f"
st = "status -sb"
ll = "log --oneline"
cm = "commit -m"
undo = "reset --soft HEAD~1"
last = "log -1 HEAD --stat"
ac = "!git add -A && git commit"
br = "branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate"
dc = "diff --cached"
aa = "add ."
std = "diff --stat"
boobs = "!git add . && git commit --amend --no-edit --no-verify && git push -f"
pr = "pull --rebase"
s = "switch"
# Remove branches that have already been merged with main.
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
ap = "!git add . -p"
# Seach commits by commit message.
sm = "!f() { \
git log --date=short --decorate --pretty=custom --grep=\"$1\"; \
}; f"
# Remove last commits (by default it removes the last commit).
rlc = "!f() { \
number_of_commits=\"${1:-1}\"; \
git reset --hard \"HEAD~$number_of_commits\"; \
}; f"
[color]
ui = true
[fetch]
prune = true
[core]
editor = nvim
excludesFile = ~/.gitignore_global
pager = delta
autocrlf = input
[diff]
colorMoved = default
navigate = true # use n and N to move between diff sections
renames = copies # Detect copies as well as renames.
tool = nvim
[difftool "nvim"]
cmd = nvim $LOCAL $REMOTE
[help]
autoCorrect = immediate # If a command is mistyped, make Git automatically run the command it thinks the user wanted to type.
[pretty]
custom = "%C(magenta)%h%C(red)%d %C(yellow)%ar %C(green)%s %C(yellow)(%an)"
# │ │ │ │ └─ author name
# │ │ │ └─ message
# │ │ └─ date (relative)
# │ └─ decorations (branch, heads or tags)
# └─ hash (abbreviated)
[rerere]
enabled = true
[branch]
# Show most recently changed branches first.
sort = -committerdate
[branch]
# Show most recently changed branches first.
sort = -committerdate
[delta]
features = gruvmax-fang line-numbers decorations
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
[interactive]
diffFilter = delta --color-only
[pull]
rebase = true
[rebase]
autoStash = true
[fetch]
prune = true
[push]
autoSetupRemote = true