git 合并dev 到master 问题
高洛峰
高洛峰 2017-05-02 09:22:08
0
2
558

当我在 3 合并到master 时, 不想要1 的提交,怎么办 ???

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
左手右手慢动作

Without committing 1, directly save the changes temporarily, which is equivalent to pulling another branch, then switching to master to merge the branch, and then deleting the temporary save, which is equivalent to deleting another branch, thus ensuring that develop is clean

洪涛

In fact, your question itself is a bit problematic. There is a commit before 1 in the dev branch (the difference compared to master). You said you don’t want 1, but do you want the one before 1?

If you only want 3 and don’t want the first one, then cherrypick 3; if you want the first one of 3 and 1, you can also cherrypick these two separately and skip 1; in a similar situation, if there are many things you want in the middle (or unwanted), you can also rebase interactively before merging.

In fact, the operating methods of git are very diverse. I can think of three or four ways to solve your problem, so I’d better take some time to learn it carefully, and I won’t ask this kind of question in the future, because I think this There is no optimal solution to this problem, it depends on the specific situation.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template