Intelligent branch switching for git