开发者

git apply a patch as much as possible when failing

开发者 https://www.devze.com 2023-01-18 21:54 出处:网络
I am moving from one repository to another and need to port some of the changes. The directory structure is mostly the same but the files not all identical.

I am moving from one repository to another and need to port some of the changes. The directory structure is mostly the same but the files not all identical.

I am using 'git format-patch' and 'git am' or 'git apply' to port those changes. When it works, life is good, but when it fails because of some minor change or files missing, nothing gets applied.

开发者_如何转开发

I can filter files out using --exclude, but what I really would like is that it applies as much as it can and just tell me where there are conflicts / failure.

I am also open to other option for applying the patches or things like that.


The --reject option is probably what you're looking for. With that, you'll get classic .rej files for failing chunks, while all the good chunks will be applied.


You could also try git apply --3way.

0

精彩评论

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