在存储库和非存储库之间创建 git 补丁
Create a git patch between repository and non-repository
我有一个文件夹需要修补以与存储库处于相同状态的情况。考虑这个小故事:
10 岁的 Goofus 和 Gallant 有点相似,在岔路口 Gallant 继续前进并成为一个更好的人。 Goofus 闲逛,什么都不做。万能的尖头决定 Goofus 必须再次变得更像 Gallant。 Gallant 如何在不克隆 Goofus 的情况下修补他?
- Goofus 和 Gallant 相似但不完全相同
- Gallant 进入存储库
- 达到了英勇的里程碑
- Goofus 需要修补到 Gallant
获取补丁的最佳方式是什么?
我应该创建一个分支并将 Gallant 变异回 Goofus,然后制作一个反向补丁吗?
如果你想简单地将 Goofus 导入回 Gallant(这将与补丁相同),只需下载 Goofus 的存档(zip 或 tarball),并在某处解压缩,然后将其用作工作树一次性导入:
cd /path/to/Gallant
git --work-tree=/path/to/Unzipped/Goofus add .
git commit -m "Goofus import"
git push
git add
部分将检测 Goofus 中任何修改、添加或删除的文件,并将它们添加到 Gallant 存储库中。
我有一个文件夹需要修补以与存储库处于相同状态的情况。考虑这个小故事:
10 岁的 Goofus 和 Gallant 有点相似,在岔路口 Gallant 继续前进并成为一个更好的人。 Goofus 闲逛,什么都不做。万能的尖头决定 Goofus 必须再次变得更像 Gallant。 Gallant 如何在不克隆 Goofus 的情况下修补他?
- Goofus 和 Gallant 相似但不完全相同
- Gallant 进入存储库
- 达到了英勇的里程碑
- Goofus 需要修补到 Gallant
获取补丁的最佳方式是什么?
我应该创建一个分支并将 Gallant 变异回 Goofus,然后制作一个反向补丁吗?
如果你想简单地将 Goofus 导入回 Gallant(这将与补丁相同),只需下载 Goofus 的存档(zip 或 tarball),并在某处解压缩,然后将其用作工作树一次性导入:
cd /path/to/Gallant
git --work-tree=/path/to/Unzipped/Goofus add .
git commit -m "Goofus import"
git push
git add
部分将检测 Goofus 中任何修改、添加或删除的文件,并将它们添加到 Gallant 存储库中。