123456789101112131415161718192021 |
- #!/bin/bash
-
- gitver=$(git --version | cut -d ' ' -f 3)
- if [[ "x$gitver" > "x1.8" ]]; then
- tilde='~'
- else
- tilde=$HOME
- fi
-
- host=$(hostname -s)
- user=$(whoami)
-
- mkconfig() {
- echo "[include]"
- echo " path = $tilde/.gittum/main.gitconfig"
- echo " path = $tilde/.gittum/host/$host.gitconfig"
- echo " path = $tilde/.gittum/user/$user.gitconfig"
- echo " path = $tilde/.gittum/private.gitconfig"
- }
-
- mkconfig >>"$HOME/.gitconfig"
|