将他人的贡献与较小的更改合并
将别人的贡献合并到另一个分支中,但在此过程中进行一些细微调整的好方法是什么?没有合并困难(事实上,快进就可以了),但有一些拼写错误和风格差异我想调整。
显然,我可以合并(快进),然后进行更改并再次提交。
我还可以执行 git merge --no-ff --no-commit 强制进行真正的合并,进行更改,然后提交合并。
可能还有其他我不知道的选项。
哪种方法最容易让我和其他人回顾并理解发生了什么?
What is a good way to take someone else's contribution and merge it into another branch, but making some minor adjustments in the process? There are no merge difficulties (in fact, a fast-forward would work), but there are some spelling errors and style differences that I would like to adjust.
Obviously, I could merge (fast-forward) and then make the changes and commit again.
I could also do git merge --no-ff --no-commit
force a true merge, make the changes, and then commit the merge.
There may be other options that I am not aware of.
Which method will be easiest for me and others to look back on and understand what happened?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试交互式变基。
我假设其他人的更改位于
other/feature
中,并且您正在合并到 master 中。使用edit
(或只是e
)标记包含错误的提交,然后使用git commit --amend
和git rebase - -继续编辑并循环提交。
Try interactive rebasing.
I assume the other person's changes are in
other/feature
and you're merging into master. Doand mark the commits containing error with
edit
(or juste
), then usegit commit --amend
andgit rebase --continue
to edit and loop through the commits.