例如,有两个分支: master和develop
进入gitcheckoutmaster//master分支
使用git check out-bfrommaster//master作为源创建分支frommaster
进入gitcheckoutDevelop//Develop分支
以git check out-bfromdevelop//develop为源创建本地分支fromdevelop
将git push originfromdevelop //本地fromdevelop分支作为远程fromdevelop分支
要将fromdevelop分支合并到develop分支:
首先切换到develop分支,然后运行: git merge fromdevelop
Please enter a commit message to explain why this merge is necessary.
请输入提交消息来解释为什么这种合并是必要的
在合并pull或分支时,git可能会遇到此接口。 很好。 (直接往下3、4步),输入说明需要:
1 .按键盘字母I进入插入模式
2 .修改最上面一行黄色合并信息,可以不修改
3 .按键盘左上角的“Esc”
4 .键入' : WQ ',注意是冒号wq,然后按回车键即可
gitpushorigin : fromdevelop//删除远程from develop分支
PS :
将本地test分支作为$ gitpushorigintest :主//远程主分支提交
$ git push origin test:test //将本地test分支作为远程test分支提交
$ git branch -d BranchName //删除本地分支