123456789101112131415161718192021222324 |
- #!/bin/bash
-
- git_binary=`which git`
-
- if [[ -x $HOME/bin/git ]]; then
- git_binary=$HOME/bin/git
- fi
-
- gitver=`$git_binary --version | cut -d ' ' -f 3`
- if [[ "$gitver" > "1.8" ]]; then
- tilde='~'
- else
- tilde=$HOME
- fi
-
- host=`hostname -s`
- user=`whoami`
-
- printf "[include]\n" >> ~/.gitconfig
- printf " path = $tilde/.gittum/before.gitconfig\n" >> ~/.gitconfig
- printf " path = $tilde/.gittum/host/$host.gitconfig\n" >> ~/.gitconfig
- printf " path = $tilde/.gittum/user/$user.gitconfig\n" >> ~/.gitconfig
- printf " path = $tilde/.gittum/private/gitconfig\n" >> ~/.gitconfig
- printf " path = $tilde/.gittum/after.gitconfig\n" >> ~/.gitconfig
|