1. 切换git远程分支,使用命令:git checkout -b 分支名称. 注意:切换远程分支一定要带伤-b 参数,只有切换本地分支的时候才不需要 -b参数,-b 的意思是 base,以当前分支为 base,新建一个名叫xxx 的分支 .如果使用 "git branch 远程分支名" 命令切换到远程服务器分支上, 则会导致如下错误提示: You are in 'detached HEAD' state. You can look around
问题描述从远程git上拉取某一个分支,然后报错,拉取不了这个分支. 拉取分支的命令: git checkout -b xxx-static-19 origin/xxx-static-19 其中xxx-static-19是分支名. 报错 fatal: 'origin/xxx-static-19' is not a commit and a branch 'xxx-static-19' cannot be created from it 解决重新拉取数据,git pull ,然后再切回分支