swcarpentry/workshop-template — pull request #111 by drlabratory (2014-12-30 03:15:38+00:00)
Title: Command file to add alias for scm git to profile

Newer versions of Mac OS X actually come with git, kind of. A binary in `/usr/bin/git` exists by default, but trying to run it will trigger a prompt to install the Xcode command line tools. Even after installing SCM git, `/usr/bin/git` is still ahead of `/usr/local/git/bin/git`in the `$PATH`. This is what leads to the infamous situation of people installing SCM git like they are supposed to, but still getting that damn pop-up on the first morning of the workshop.

This script attempts to rectify that by adding an alias for `git` to the user's `.bashrc` or `.bash_profile`. I think this is better than trying to mess with users' `$PATH` in a reliable way. It is a `.command` file, which means users can just double click it to run it in the Terminal. It tries to be a unobtrusive as possible.

The alternative would be to have users just install the Xcode command line tools instead of SCM git, but I'm not sure how big it is.

Comments/changes welcome.