Skip to content

Commit

Permalink
feat: greatly improve and refine Git config
Browse files Browse the repository at this point in the history
Signed-off-by: Vladyslav Dukhin <15850680+primeare@users.noreply.github.com>
  • Loading branch information
primeare committed Sep 10, 2024
1 parent 11f3fa1 commit 9b2114b
Showing 1 changed file with 60 additions and 19 deletions.
79 changes: 60 additions & 19 deletions .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,50 @@

[init]
defaultBranch = main
[push]
default = current
followTags = true
[status]
aheadBehind = true
submoduleSummary = true
showUntrackedFiles = all
showStash = true
renames = copies
[branch]
autoSetupMerge = always
autoSetupRebase = always
sort = -committerdate
[fetch]
prune = true
writeCommitGraph = true
[pull]
rebase = true
rebase = true # merges
[push]
default = upstream
followTags = true
autoSetupRemote = true
[rebase]
autoStash = true
updateRefs = true
[branch]
autosetupmerge = always
autosetuprebase = always
sort = -committerdate
missingCommitsCheck = error
[commit]
cleanup = strip
template = ~/.gitmessage
[diff]
tool = vscode
renames = copies
mnemonicPrefix = true
submodule = log
[difftool "vscode"]
cmd = code --wait --diff "$REMOTE" "$LOCAL"
[merge]
tool = vscode
autoStash = true
[mergetool]
keepBackup = false
keepTemporaries = false
writeToTemp = true
prompt = false
[mergetool "vscode"]
cmd = code --wait --merge "$REMOTE" "$LOCAL" "$BASE" "$MERGED"
trustExitCode = true
[user]
name = Vladyslav Dukhin
email = 15850680+primeare@users.noreply.github.com
[credential]
helper = osxkeychain
[core]
editor = code --wait
pager = less --quit-if-one-screen
Expand All @@ -41,9 +56,31 @@
ui = auto
[column]
ui = auto
[commit]
cleanup = strip
template = ~/.gitmessage
[user]
name = Vladyslav Dukhin
email = 15850680+primeare@users.noreply.github.com
[credential]
helper = osxkeychain
[grep]
break = true
heading = true
lineNumber = true
extendedRegexp = true
[log]
abbrevCommit = true
follow = true
showSignature = true
[tag]
sort = version:refname
[versionsort]
suffix = -pre
suffix = .pre
suffix = -alpha
suffix = .alpha
suffix = -beta
suffix = .beta
suffix = -rc
suffix = .rc
[rerere]
# Reuse Recorded Resolution
enabled = true
Expand All @@ -53,7 +90,7 @@
port = 4321
[alias]
# ex. (git s)
s = status --show-stash --ahead-behind --renames
s = status
# ex. (git c)
c = commit --signoff
# ex. (git ca)
Expand All @@ -67,10 +104,10 @@
# pushes changes to the remote branch of the same name
# ex. (git p)
p = push origin HEAD # use --signed flag
fp = push --force-with-lease origin HEAD
fp = push --force-with-lease --force-if-includes origin HEAD
# outputs the log graph of git history with statistics
# ex. (git l)
l = log --oneline --graph --decorate --stat --show-signature
l = log --oneline --graph --decorate --date=relative --stat
# stash the changes in a dirty working directory away, include untracked
# ex. (git st "some awesome code")
st = stash push --include-untracked --message
Expand All @@ -82,4 +119,8 @@
# outputs a condensed summary of the working directory against the branch
# ex. (git summary, git summary main)
summary = diff --word-diff --compact-summary
# undo last commit but keep changes in stage
undo = reset --soft HEAD~1
# ex. (git aliases)
aliases = config --get-regexp alias
# git maintenance start

0 comments on commit 9b2114b

Please sign in to comment.