git操作branch分支
假设现在本地代码和master代码一致
1 创建分支
git branch mybranch
2 切换分支
git checkout mybranch
3 查看status
git status
显示:
On branch mybranch
nothing to commit, working tree clean
4 新建文件
touch a.txt
5 添加到本地
git add a.txt
6 提交到本地仓库
git commit -m "bala"
7 push
git push --set-upstream origin mybranch
8 切换到master
git checkout master
9 合并
git merge mybranch
10 git push
git push