我怎样才能将我的分叉回购的部分更改提交为补丁? [英] How can I submit partial change of my forked repo as patch?
问题描述
我从GitHub中分出了一个回购并做了一系列更改。然后我发现我在一个文件中的修改可以是原始回购问题的补丁,但作者不想合并我的其他修改,所以我不想直接发送拉请求。我认为再次分叉,只是修改该文件来创建一个补丁,然后发送拉请求似乎并不那么优雅。有没有什么标准的方式来做到这一点?
在我看来,你应该使用相同的根,然后使用樱桃选择添加您所做的每一个提交,除非作者不接受。
然后在这个分支上发送一个拉取请求。$ b $另外,如果你想把所有的修改重新组合成一个简单的提交,你可以使用 =noreferrer>压扁重新分配。
I forked a repo from GitHub and make a bunch of changes. Then I found one of my modification in one file can be a patch to an issue of the original repo, but the author don't want to merge my other modifications, so I don't want to send a pull request directly. And I think forking it again and just modify that file to make a patch and then send pull request seems not so elegant. Are there any "standard" way to do that?
In my opinion, you should make a new branch with the same root, then use cherry-pick to add every commit you made except those who are not accepted by the author.
Then send a pull request on this branch.
Moreover, if you want to regroup all your modifications into one simple commit, you may use a squash rebase on a local branch before pushing it online.
这篇关于我怎样才能将我的分叉回购的部分更改提交为补丁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!