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/.git-universe/before.gitconfig\n" >> ~/.gitconfig
- printf " path = $tilde/.git-universe/host/$host.gitconfig\n" >> ~/.gitconfig
- printf " path = $tilde/.git-universe/user/$user.gitconfig\n" >> ~/.gitconfig
- printf " path = $tilde/.git-universe/private/gitconfig\n" >> ~/.gitconfig
- printf " path = $tilde/.git-universe/after.gitconfig\n" >> ~/.gitconfig
|