Skip to main content
czerasz.com: notes
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Git

Git configuration can be stored in

~/.config/git/
├── config
├── ignore
└── template

or ~/.gitconfig


Example ~/.config/git/config

# source: https://github.com/codingjerk/dotfiles/blob/main/config/git/config
[user]
  name = ...
  email = ...

[core]
  editor       = vim
  compression  = 9
  whitespace   = error
  preloadindex = true

[init]
  defaultBranch = main

[status]
  branch = true
  showStash = true
  showUntrackedFiles = all

[push]
  autoSetupRemote = true
  default = current
  # followTags = true

[pull]
  default = current
  # rebase = true

[rebase]
  autoStash = true
  missingCommitsCheck = warn

# [diff]
#   context = 3
#   renames = copies
#   interHunkContext = 10
#
# [color "diff"]
#   meta       = black bold
#   frag       = magenta
#   context    = white
#   whitespace = yellow reverse
#   old        = red
#
# [pager]
#   diff = diff-so-fancy | $PAGER
#
# [diff-so-fancy]
#   markEmptyLines = false

[advice]
  addEmptyPathspec = false
  pushNonFastForward = false
  statusHints = false

[url "git@github.com:"]
  insteadOf = "gh:"