Improved git clone and checkout logic

asdf

asdf
Brian didn't know about TrimSpace
Fixed hg clone bug
Impoved TrimmedCmd and suppressed some git out about detached HEAD