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/.config/gittum/main.gitconfig"
- echo " path = $tilde/.config/gittum/host/$host.gitconfig"
- echo " path = $tilde/.config/gittum/user/$user.gitconfig"
- echo " path = $tilde/.config/gittum/private.gitconfig"
- }
-
- mkconfig >>"$HOME/.gitconfig"
|