- 将当前代码切换到新分支
git branch -a //查看远程分支
git branch //查看本地分支
git branch test //新建本地分支
git push origin test //推送分支到远程
git checkout test // Switched to branch 'test' 切换到分支test
git checkout -b //XXX---新建XXX分支,并切换至XXX分支
git branch -a //查看远程分支
git branch //查看本地分支
git branch test //新建本地分支
git push origin test //推送分支到远程
git checkout test // Switched to branch 'test' 切换到分支test
git checkout -b //XXX---新建XXX分支,并切换至XXX分支