Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的仓库中有一个名为 some/work/file.py 的文件。
我一直在 repo 中工作(除了 file.py 之外的其他文件)并提交我的更改,并且已经从修订版 20 到 30。
我将如何仅为修订版 20 到 30 的 file.py 创建一个补丁,而不包括其他文件?
就像是:
hg export 20:30 file.py > new.patch
已尝试该命令但不起作用。
谢谢
hg export将单个变更集导出为单独的实体。
hg export
如果我理解正确,您需要回答“file.c修订版 20 和修订版 30 之间发生了哪些变化?”这个问题,即您只需要一个差异文件。
file.c
以下是您的操作方法:
hg diff file.c -r 20:30 > new.diff
作为一种更通用的方法,您可以使用-I(包含文件模式)/ -X(排除)。
-I
-X