将差异从diff文件提取到当前分支 [英] Extract changes from diff file to current branch

查看:141
本文介绍了将差异从diff文件提取到当前分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用以下文件生成的文件:

I have a file that I generated by using:

〜git diff --color>差异文件

~ git diff --color > diff.file

现在我想把它带到当前分支中.

And I now want to bring that onto my current branch.

我尝试使用:

〜git apply diff.file

~ git apply diff.file

尽管响应是致命的:无法识别的输入

Although that responds with fatal: unrecognized input

推荐答案

-color 标志使diff.file成为二进制文件,使用 git apply

The --color flag makes diff.file into a binary file which is unable to be read when using git apply

删除--color标志会导致文件容易被git apply读取.

Removing the --color flag resulted in a file that was easily readable for git apply.

这篇关于将差异从diff文件提取到当前分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆