My dotfiles. Period.

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. git_binary=$(which git)
  3. if [[ -x "$HOME/bin/git" ]]; then
  4. git_binary="$HOME/bin/git"
  5. gitver=$(git --version | cut -d ' ' -f 3)
  6. if [[ "x$gitver" > "x1.8" ]]; then
  7. tilde='~'
  8. else
  9. tilde=$HOME
  10. fi
  11. host=$(hostname -s)
  12. user=$(whoami)
  13. mkconfig() {
  14. echo "[include]"
  15. echo " path = $tilde/.gittum/main.gitconfig"
  16. echo " path = $tilde/.gittum/host/$host.gitconfig"
  17. echo " path = $tilde/.gittum/user/$user.gitconfig"
  18. echo " path = $tilde/.gittum/private.gitconfig"
  19. }
  20. mkconfig >>"$HOME/.gitconfig"