summaryrefslogtreecommitdiffstats
path: root/.setup/confgit.sh
blob: 33c5e065791b590358527465094a04eea9b1962e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env zsh

rm ~/.gitconfig # Purge existing gitconf

# Dotfiles config
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME config protocol.version 2
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME config pull.ff only
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME config push.default simple
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME config status.showUntrackedFiles no

# Main Git Config
git config --global checkout.workers 0 # Auto-detect threads from CPU
#git config --global checkout.thresholdForParallelism  # Unknown good value
git config --global core.commitGraph true
git config --global credential.https://source.developers.google.com.helper "gcloud.sh"
git config --global fetch.parallel 4
git config --global fetch.writeCommitGraphs true
git config --global hub.protocol https
git config --global init.defaultBranch main
git config --global pack.threads 0 # Auto-detect threads from CPU
git config --global pack.writeReverseIndex true
git config --global protocol.version 2
git config --global pull.ff only
git config --global pull.twohead ort # Use new faster merge algorithm
git config --global push.default simple
git config --global push.followTags true
git config --global status.submodulesummary 1
git config --global user.email tydavis@gmail.com
git config --global user.name "Tyler Davis"

# if [ "$(command -v delta)" ]; then
#   git config --global core.pager delta
#   git config --global delta.line-numbers true
#   git config --global delta.side-by-side false
#   git config --global interactive.diffFilter "delta --color-only"
# fi

case `uname` in
  Darwin)
    # commands for OS X go here
    git config --global core.editor nvim
    git config --global diff.tool nvim
    git config --global merge.tool nvim
    #git config --global core.editor "code --wait"
    #git config --global merge.tool vscode
    #git config --global diff.tool vscode
    git config --global core.excludesfile "/Users/tydavis/.gitignore_global"
    git config --global credential.helper osxkeychain
    git config --global difftool.nvim.cmd "nvim -d \$LOCAL \$REMOTE \$MERGED -c 'wincmd w' -c 'wincmd J'"
    git config --global difftool.vscode.cmd "code --wait --diff \$LOCAL \$REMOTE"
    git config --global http.cookiefile /Users/tydavis/.gitcookies
    git config --global mergetool.vscode.cmd "code --wait \$MERGED"
  ;;
  Linux)
    # commands for Linux go here
    git config --global core.editor nvim
    git config --global diff.tool nvim
    git config --global merge.tool nvim
    #git config --global core.editor "code --wait"
    #git config --global merge.tool vscode
    #git config --global diff.tool vscode
    git config --global core.excludesfile "/home/tydavis/.gitignore_global"
    git config --global credential.helper "store --file=/home/tydavis/.config/gitcreds"
    git config --global difftool.nvim.cmd "nvim -d \$LOCAL \$REMOTE \$MERGED -c 'wincmd w' -c 'wincmd J'"
    git config --global difftool.vscode.cmd "code --wait --diff \$LOCAL \$REMOTE"
    git config --global http.cookiefile /home/tydavis/.gitcookies
    git config --global mergetool.cmd "code --wait \$MERGED"
  ;;
  FreeBSD)
    # commands for FreeBSD go here
  ;;
esac