git 591 B

123456789101112131415161718
  1. #!/bin/bash
  2. set -o errexit -o pipefail
  3. has git || gimme_pkg git
  4. [[ "$(git config --global --get core.pager)" ]] || git config --global core.pager 'less --raw-control-chars'
  5. [[ "$(git config --global --get color.ui)" ]] || git config --global color.ui true
  6. [[ "$(git config --global --get push.default)" ]] || git config --global push.default simple
  7. if ! [[ "$(git config --global --get credential.helper)" ]]; then
  8. if [[ "$OS" = "Darwin" ]]; then
  9. git config --global credential.helper "osxkeychain"
  10. else
  11. git config --global credential.helper "cache --timeout=3600"
  12. fi
  13. fi