[core]
  pager = "eval ${GITPAGER:-less -RFX}"
  fsmonitor = true
  untrackedCache = true
  # Windows defaults this to false and its init/clone "probe" can never say
  # otherwise: mingw's symlink() returns ENOSYS unless this is already true, so
  # every fresh clone writes core.symlinks=false and checks symlinks out as
  # text stubs. Setting it globally opts in. Needs Developer Mode (or admin).
  symlinks = true

[color "branch"]
  current = yellow reverse
  local = yellow
  remote = green

[color "diff"]
  meta = yellow bold
  frag = magenta bold # line info
  #old = red # deletions # this is the default
  #new = green # additions # this is the default

[color "status"]
  added = green bold
  changed = red bold strike
  untracked = cyan
  branch = yellow bold ul

[diff]
colorMoved = true
colorMovedWS = allow-indentation-change
mnemonicPrefix = true
# submodule=diff

# These are ignored if you aren't running VSCode
[difftool "vscode"]
  cmd =  code --wait --diff $LOCAL $REMOTE
[mergetool "vscode"]
  cmd = code --wait --merge $REMOTE $LOCAL $BASE $MERGED

[commit]
  # https://help.github.com/articles/signing-commits-using-gpg/
  #gpgSign = true
  verbose = true

[interactive]
  diffFilter = "eval ${GITPAGER:-cat}"

[rebase]
  instructionFormat = (%al) %s

[pull]
  fastforward = true
  ff = only
  rebase = true

[feature]
  experimental = true
  manyFiles = true

[user]
  email = mchcopl@gmail.com
  name = Max 👨🏽‍💻 Coplan
  signingKey = ~/.ssh/id_rsa.pub

[help]
  autocorrect = 1

# force ssh
#[url "git@github.com:"]
#  insteadOf = "https://github.com/"

[http]
  cookiefile = ~/.gitcookies
[rerere]
  enabled = true

[include]
  path = ~/dotfiles/bytedance_private.gitconfig
[includeIf "gitdir:~/code/code.*.org/**/"]
	path = ~/dotfiles/work.gitconfig

[maintenance]
  repo = ~/workspace/github.com/vegerot/APODesktop
  repo = ~/workspace/github.com/vegerot/dotfiles

[gpg]
  format = ssh

[alias]
    # Switch fast
    s = "!{ git for-each-ref --sort=-committerdate --format='%(refname)' refs/heads/ refs/remotes/$(git remote || printf origin)|sed -e 's-refs/heads/--'| sed -e \"s-refs/remotes/$(git remote || printf origin)/--\" & printf 'develop\nmain\nmaster\n'; } | uniq | grep -i -m1 --color=never $1 | xargs -I {} sh -c \" echo {}; git switch {}\""

  fr = !git fetch $(git remote | head) && git rebase
  frm = !git fetch $(git remote | head) && git rebase $(git remote | head)/main
  fru = !git fetch upstream && git rebase upstream/main
  cw = commit --fixup=wip

    # Switch fuzzy
    sf = !git switch $(git for-each-ref --sort=-committerdate --format='%(refname)' refs/heads/ refs/remotes/$(git remote || printf origin)/|sed -e 's-refs/heads/--'| sed -e \"s-refs/remotes/$(git remote || printf origin)/--\" | uniq | fzf) $@

[credential "https://github.com"]
	helper = !gh auth git-credential
[credential "https://gist.github.com"]
	helper = !gh auth git-credential
[gpg "ssh"]
	allowedSignersFile = ~/.ssh/allowed_signers
