从master copy子分支
git status 查看当前分支,显示为master
# On branch master
创建一个子分支 dev
git checkout -b dev
子分支代码合并到主干
先把子分支push到远程仓库
git push -u origin dev
切换分支到master
git checkout master
git pull
pull如果不正常需要先解决冲突
合并到master操作
git merge dev
git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
git push origin master
合并完成