简体   繁体   English

最后一次提交拉到主分支 git

[英]Last commit pull to master branch git

i just want to send the code of the last commit from developer to the master branch, please explain me how it works My structure is我只想将最后一次提交的代码从开发人员发送到主分支,请解释一下它是如何工作的 我的结构是

origin
|
---developer
|    |
|     --- > start commit start.cpp
|     --- >commit 1
|     --- >commit 2
|     --- >commit 3
|     --- >commit 4
---master
     |  
     --- > start commit start.cpp

You'd need to create a new branch from master, cherry-pick the one commit, and send that.您需要从 master 创建一个新分支,挑选一个提交,然后发送它。

Or you could push up your dev branch and allow the other developer to cherry-pick the one commit.或者你可以推高你的开发分支并允许其他开发人员挑选一个提交。

您可以在分支签出时挑选最后一次提交。

git cherry-pick <last-commit-id>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM