开发者

rebasing git branches that were rewritten since branching

开发者 https://www.devze.com 2023-03-05 22:23 出处:网络
I have a git repository and two branches master and st (branched from master). I want to rebase st onto master. However, master has been massively rewritten by somebody else, to be frank I\'m not sure

I have a git repository and two branches master and st (branched from master). I want to rebase st onto master. However, master has been massively rewritten by somebody else, to be frank I'm not sure why, but we were prompted to fetch the new master and reset --hard our private branches to it.

If I try git-rebase the listing of non-trivially conflicted files that need manual merges span over two screen pages. I know that the actual changes are not that much. For one, the st branch only touched a handful of files (not more than ten, I'd guess).

Besides rebasing I tried to create a patch开发者_如何学Go and apply it, but there are some conflicts as well, which I have no clue how to resolve.


The solution appears to be mind-bogglingly easy, as suggested by this answer, you can simply do

git am -3 changes.patch

if changes.patch is the full patch file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号