Skip to content

Commit 9b2114b

Browse files
committed
feat: greatly improve and refine Git config
Signed-off-by: Vladyslav Dukhin <[email protected]>
1 parent 11f3fa1 commit 9b2114b

File tree

1 file changed

+60
-19
lines changed

1 file changed

+60
-19
lines changed

.gitconfig

Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,50 @@
22

33
[init]
44
defaultBranch = main
5-
[push]
6-
default = current
7-
followTags = true
5+
[status]
6+
aheadBehind = true
7+
submoduleSummary = true
8+
showUntrackedFiles = all
9+
showStash = true
10+
renames = copies
11+
[branch]
12+
autoSetupMerge = always
13+
autoSetupRebase = always
14+
sort = -committerdate
815
[fetch]
916
prune = true
1017
writeCommitGraph = true
1118
[pull]
12-
rebase = true
19+
rebase = true # merges
20+
[push]
21+
default = upstream
22+
followTags = true
23+
autoSetupRemote = true
1324
[rebase]
25+
autoStash = true
1426
updateRefs = true
15-
[branch]
16-
autosetupmerge = always
17-
autosetuprebase = always
18-
sort = -committerdate
27+
missingCommitsCheck = error
28+
[commit]
29+
cleanup = strip
30+
template = ~/.gitmessage
1931
[diff]
2032
tool = vscode
2133
renames = copies
34+
mnemonicPrefix = true
35+
submodule = log
2236
[difftool "vscode"]
2337
cmd = code --wait --diff "$REMOTE" "$LOCAL"
2438
[merge]
2539
tool = vscode
40+
autoStash = true
41+
[mergetool]
42+
keepBackup = false
43+
keepTemporaries = false
44+
writeToTemp = true
45+
prompt = false
2646
[mergetool "vscode"]
2747
cmd = code --wait --merge "$REMOTE" "$LOCAL" "$BASE" "$MERGED"
2848
trustExitCode = true
29-
[user]
30-
name = Vladyslav Dukhin
31-
32-
[credential]
33-
helper = osxkeychain
3449
[core]
3550
editor = code --wait
3651
pager = less --quit-if-one-screen
@@ -41,9 +56,31 @@
4156
ui = auto
4257
[column]
4358
ui = auto
44-
[commit]
45-
cleanup = strip
46-
template = ~/.gitmessage
59+
[user]
60+
name = Vladyslav Dukhin
61+
62+
[credential]
63+
helper = osxkeychain
64+
[grep]
65+
break = true
66+
heading = true
67+
lineNumber = true
68+
extendedRegexp = true
69+
[log]
70+
abbrevCommit = true
71+
follow = true
72+
showSignature = true
73+
[tag]
74+
sort = version:refname
75+
[versionsort]
76+
suffix = -pre
77+
suffix = .pre
78+
suffix = -alpha
79+
suffix = .alpha
80+
suffix = -beta
81+
suffix = .beta
82+
suffix = -rc
83+
suffix = .rc
4784
[rerere]
4885
# Reuse Recorded Resolution
4986
enabled = true
@@ -53,7 +90,7 @@
5390
port = 4321
5491
[alias]
5592
# ex. (git s)
56-
s = status --show-stash --ahead-behind --renames
93+
s = status
5794
# ex. (git c)
5895
c = commit --signoff
5996
# ex. (git ca)
@@ -67,10 +104,10 @@
67104
# pushes changes to the remote branch of the same name
68105
# ex. (git p)
69106
p = push origin HEAD # use --signed flag
70-
fp = push --force-with-lease origin HEAD
107+
fp = push --force-with-lease --force-if-includes origin HEAD
71108
# outputs the log graph of git history with statistics
72109
# ex. (git l)
73-
l = log --oneline --graph --decorate --stat --show-signature
110+
l = log --oneline --graph --decorate --date=relative --stat
74111
# stash the changes in a dirty working directory away, include untracked
75112
# ex. (git st "some awesome code")
76113
st = stash push --include-untracked --message
@@ -82,4 +119,8 @@
82119
# outputs a condensed summary of the working directory against the branch
83120
# ex. (git summary, git summary main)
84121
summary = diff --word-diff --compact-summary
122+
# undo last commit but keep changes in stage
123+
undo = reset --soft HEAD~1
124+
# ex. (git aliases)
125+
aliases = config --get-regexp alias
85126
# git maintenance start

0 commit comments

Comments
 (0)