Stackoverflow: http://stackoverflow.com/questions/471300/git-switch-branch-without-detaching-head git branch --track experimental origin/experimental git checkout experimental