]> git.netwichtig.de Git - user/henk/vcsh/git.git/blobdiff - .config/git/config
add aliases for amending
[user/henk/vcsh/git.git] / .config / git / config
index 0cc42369ba4f2149eaed61ac7a878bbfd8a7b53c..e064a37061a32e461860c8ee9ca7d58a1f19b0a9 100644 (file)
@@ -1,7 +1,6 @@
-[user]
-  name = Hendrik Jäger
-  email = gitcommit@henk.geekmail.org
-  signingKey = 0x1B7EADFDDF720123
+[include]
+  # for [user] section with email, realname, signing key, etc
+  path = personal.conf
 
 [branch]
   # always make new branches rebase on their tracking branch
   verbose = true
 [core]
   # complain about tabs used for indenting
-  whitespace = tab-in-indent
+  # commented because I switched to tabs
+  # and yaml can’t use tabs
+  # so either variant will  complain
+  # whitespace = tab-in-indent
 [diff]
   # use (i)ndex, (w)orktree, (c)ommit, etc instead of a/ and b/
   mnemonicprefix = true
@@ -34,6 +36,8 @@
 [grep]
   # show linenumber (-n)
   lineNumber = true
+[init]
+  defaultBranch = main
 [log]
   # show short commit sha
   abbrevCommit = true
@@ -42,6 +46,8 @@
 [merge]
   # use vimdiff as mergetool
   tool = vimdiff
+  # this shows the ancestor
+  conflictstyle = diff3
 [pretty]
   compact = %C(auto)%h%Cgreen% cs%Cblue%<(15,trunc)% an%C(auto)%d%Creset% s
 [push]
@@ -73,9 +79,9 @@
   b      = branch
   br     = branch
   bra    = branch --all
+  brav   = branch --all --verbose --verbose
 
   co  = checkout
-  cob = checkout -b
 
   cp  = cherry-pick
   cpa = cherry-pick --abort
 
   c     = commit
   ca    = commit --all
+  caa   = commit --all --amend
+  c-a   = commit --amend
   cm    = commit --message
   cam   = commit --all --message
   fix   = commit --all --fixup
 
-  diff  = diff --word-diff
   d     = diff --word-diff
   dc    = diff --cached
   dlc   = diff --cached HEAD^
   # grep on filename
   f = "!git ls-files | grep -i"
 
-  g    = grep -Ii
-  gr   = grep -Ii
-  grep = grep -Ii
+  g    = grep -I
+  gr   = grep -I
+  gra  = "!sh -c 'git grep "$0" "$@" "$(git for-each-ref --format=\"%(refname)\"" refs/)'"
+  grep = grep -I
 
-  l       = log
+  log     = log --graph
+  l       = log --graph
   la      = log --graph --all
+  lap     = log --graph --all --patch
   lp      = log --patch
+  ls      = log --stat
   # tag logs
   taglog = "log --tags --simplify-by-decoration --pretty='format:%ci %d'"
 
   remp = remote prune
   remu = remote update
 
-  rb  = rebase
-  rba = rebase --abort
-  rbc = rebase --continue
-  rbi = rebase --interactive
+  frbp = "!f() { git fetch; git rebase "$1"; git push --force-with-lease; }; f"
+  rb   = rebase
+  rba  = rebase --abort
+  rbc  = rebase --continue
+  rbi  = rebase --interactive
+  rbm = "!f() { git switch "$1" && git rebase - && git switch - && git merge -; }; f"
 
   r   = reset
   r1  = reset HEAD^
 
   sl = stash list
   sa = stash apply
+  sp = stash pop
   ss = stash save
 
   st = status --short
 
   sw = switch
+  swc = switch --create
 
   # add subtree
   sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"