1. 切换git远程分支,使用命令:git checkout -b 分支名称. 注意:切换远程分支一定要带伤-b 参数,只有切换本地分支的时候才不需要 -b参数,-b 的意思是 base,以当前分支为 base,新建一个名叫xxx 的分支 .如果使用 "git branch 远程分支名" 命令切换到远程服务器分支上, 则会导致如下错误提示: You are in 'detached HEAD' state. You can look around
使用git的时候,有时候会出现远端更新了一个分支,但是从本地想checkout一个远程分支时,会出现如下错误: fatal: git checkout: updating paths is incompatible with switching branches. Did you intend to checkout 'origin/develop' which can not be resolved as commit? 并且在本地查看git branch -a,也看不到远程新加的那个分支,解