新建branch并push

  1. 切换到根底分支如master或者其余改变过的分支
git checkout master 
git checkout $OTHER_BRANCH_NAME

2.创立并切换到新分支

git checkout -b $NEW_BRANCH_NAME

能够应用git branch或者git status查看是否在new branch上。

3.更新分支代码并提交

git add .
git commit -m "init NEW_BRANCH_NAME"
git push origin $NEW_BRANCH_NAME
  • 查看remote host的所有branches:git branch -a

待续。。