config/git: improve defaults & separate out specifics

This commit is contained in:
xerus2000 2021-02-13 18:36:56 +01:00
parent ccaab803a5
commit 8d7b9a1e9b
3 changed files with 22 additions and 19 deletions

View File

@ -31,11 +31,13 @@
# Automatically push to branch with matching name # Automatically push to branch with matching name
[push] [push]
default = current default = current
[status]
showStash = true
# Disable pagination for branch commmand by default # Disable pagination for branch commmand by default
[pager] [pager]
branch = false branch = false
[grep] [grep]
lineNumber = 1 lineNumber = true
[color "status"] [color "status"]
added = green added = green
@ -72,6 +74,9 @@
b = branch -vv b = branch -vv
ba = b -a ba = b -a
co = checkout
cb = checkout -b
ref = reflog show --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' ref = reflog show --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset'
rev = rev-parse --short rev = rev-parse --short
head = rev-parse --short HEAD head = rev-parse --short HEAD
@ -100,15 +105,14 @@
aa = add -u . aa = add -u .
ap = add -p ap = add -p
c = commit -v c = commit -v
co = checkout cme = commit -v --edit --message
cb = checkout -b
cp = cherry-pick cp = cherry-pick
rb = rebase rb = rebase
rbc = rebase --continue rbc = rebase --continue
sta = stash sta = stash
stl = stash list stl = !git --no-pager stash list
sts = stash show -v sts = stash show -v
stp = stash pop stp = stash pop
std = stash drop std = stash drop
@ -120,10 +124,6 @@
format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop
# Housekeeping
gcr = !git gc && git repack -a -d
sup = !git branch --set-upstream-to @{push}
# Update from remote # Update from remote
f = fetch f = fetch
fa = fetch --all fa = fetch --all
@ -132,6 +132,7 @@
rg = rmgonebranches rg = rmgonebranches
sm = submodule update --init --recursive sm = submodule update --init --recursive
gcr = !git gc && git repack -a -d
# Change remote # Change remote
luu = !git pull upstream $(git curbranch) && git push --no-verify luu = !git pull upstream $(git curbranch) && git push --no-verify
@ -140,15 +141,8 @@
pf = push --force-with-lease pf = push --force-with-lease
cap = !git commit --all --amend --no-edit && git push --force-with-lease cap = !git commit --all --amend --no-edit && git push --force-with-lease
# COMMIT SHORTHANDS [includeIf "gitdir:~/.config/yadm/repo.git"]
cme = commit -v --edit --message path = "~/.config/yadm/gitconfig"
# yadm
cgit = !yadm cme "config/git:" -- $XDG_CONFIG_HOME/git $CONFIG_SHELLS/git $HOME/.local/bin/git-*
cvim = !yadm cme "config/nvim:" -- $XDG_CONFIG_HOME/nvim/init*
cshell = !yadm cme "config/shell:" -- $CONFIG_SHELLS
cbin = !yadm cme "bin:" -- $HOME/.local/bin
# data [includeIf "gitdir:~/data/.git"]
journal = !git cme "notes/journal:" -- $(git root)/2-standards/notes/journal path = "config-data"
note = !git cme "notes:" -- $(git root)/2-standards/notes
write = !git cme "writings:" -- $(git root)/2-standards/writing

4
.config/git/config-data Normal file
View File

@ -0,0 +1,4 @@
[alias]
journal = !git cme "notes/journal:" -- $(git root)/2-standards/notes/journal
note = !git cme "notes:" -- $(git root)/2-standards/notes
write = !git cme "writings:" -- $(git root)/2-standards/writing

5
.config/yadm/gitconfig Normal file
View File

@ -0,0 +1,5 @@
[alias]
cgit = !yadm cme "config/git:" -- $XDG_CONFIG_HOME/git $CONFIG_SHELLS/git $HOME/.local/bin/scripts/git-*
cvim = !yadm cme "config/nvim:" -- $XDG_CONFIG_HOME/nvim/init*
cshell = !yadm cme "config/shell:" -- $CONFIG_SHELLS
cbin = !yadm cme "bin:" -- $HOME/.local/bin/scripts