git apply

将补丁应用到文件和/或暂存区,但不创建提交。 另请参阅 git am,该命令不仅能应用补丁还会创建提交。 更多信息:https://git-scm.com/docs/git-apply.

git apply --verbose {{路径/到/文件}}

git apply --index {{路径/到/文件}}

curl -L {{https://example.com/file.patch}} | git apply

git apply --stat --apply {{路径/到/文件}}

git apply --reverse {{路径/到/文件}}

git apply --cache {{路径/到/文件}}