简体   繁体   English

如何将提交从另一个分支移交给master

[英]How to move commit to master from another branch

I have master branch and a developer branch. 我有master分支和developer分支。 I did some work on developer branch, and now i want to commit my final work (final project) to master branch. 我在开发人员分支上做了一些工作,现在我想将我的最终工作(最终项目)提交给master分支。 How to do that? 怎么做?

Standard: 标准:

git checkout master
git merge develop

# if there are merge conflicts, resolve them and follow with:
# git commit

That will transfer all of the historical commits on develop to master . 那将把所有关于develop的历史承诺转移到master If you want to keep master 's commit history clean, you can squash it all into one commit: 如果要保持master的提交历史记录整洁,可以将其全部压缩为一次提交:

git checkout master
git merge develop --squash
# resolve any merge conflicts
git commit

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

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