Add '-t' option to git checkout

Use '-t' option in git checkout to set upstream tracking on branches. Fixes #5476.

cc: @staticfloat, @StefanKarpinski

I think this is what was discussed in the referenced issue, but let me know if there's anything else we need to check/do here.