我想为特定的提交哈希值创建一个补丁。
我尝试使用git format-patch ,但这会为自提交以来的每个提交生成一个补丁。有没有办法只为生成一个补丁?
我尝试使用git format-patch ,但这会为自提交以来的每个提交生成一个补丁。有没有办法只为生成一个补丁?
如何生成仅针对特定SHA-1值的补丁?
很简单:
选项1:git show commitID > myFile.patch
选项2:git commitID~1..commitID > myFile.patch
注意:将commitID
替换为实际的提交ID(SHA-1提交代码)。
1..a5f4bcaeb7fa7de27ae79d9522332e872889bbf0 git: 'a5f4bcaeb7fa7de27ae79d9522332e872889bbf01..a5f4bcaeb7fa7de27ae79d9522332e872889bbf0' 不是一个 git 命令。参见 'git --help'。请在发布答案之前检查。 - Anshuman Manral