Git将修补程序应用于工作目录 [英] Git apply a patch to the working directory

查看:109
本文介绍了Git将修补程序应用于工作目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个修补程序,其中包含许多我想要拆分为多个提交并可能修改某些更改的更改。



我想将此补丁应用于我的工作目录,然后手动提交更改。是否有可能在git中将补丁应用到工作目录中?

/schacon.github.com/git/git-apply.htmlrel =noreferrer> git apply 应用补丁:

  git apply< patchname.patch 

这不会创建任何提交。事实上,没有任何选项, git apply 命令甚至不需要有一个Git仓库。它只是将补丁应用于文件。


I have a patch that contains a lot of changes that I would like to split into multiple commits and potentially modify some of the changes.

I want to apply this patch to my working directory and then manually commit the changes. Is it possible to apply a patch to the working directory in git?

解决方案

You can use git apply which applies a patch:

git apply < patchname.patch

This does not create any commits. In fact, without any options the git apply command doesn't even need to have a Git repository. It just applies patches to files.

这篇关于Git将修补程序应用于工作目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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