gpt4 book ai didi

git - diff pathspec 是如何定义的

转载 作者:太空狗 更新时间:2023-10-29 14:09:25 26 4
gpt4 key购买 nike

gitdiffcore(7) 中它只是声明:

The pathspecs are used to limit the world diff operates in. 
They remove the filepairs outside the specified sets of pathnames.
E.g. If the input set of filepairs included:

:100644 100644 bcd1234... 0123456... M junkfile

我的问题是如何阅读这个,即哪些字段是哪些,它们应该代表什么?

我正在寻找,以便我能够理解在检测路径名更改(作为一个选项)方面是否有任何里程与文件重命名检测分开,这既昂贵又倾向于向用户建议许多文件已被重命名(而不是而不是单个路径更改)

最佳答案

让我们分解一下:

:100644        100644         bcd1234...     0123456...     M         junkfile
old file mode new file mode old file hash new file hash modified file name

要在指定提交时从目录创建具有给定名称的存档,请使用 git archive command :

git archive --prefix='your_product_v1.2/' -o 'your_product.zip' v1.2:path/to/directory/

假设,你想从 path/to/directory/ 创建一个存档,就像它在版本 v.1 中一样(标签,分支,你甚至可以使用在此处提交 ID)。存档将被命名为 your_product.zip(根据文件名推断的格式,也可以是 .tar),所有文件都将放在子文件夹 your_product_v1 中。 2 在 zip 文件中。

这样你就不必重命名 VCS 中的目录(你为什么要这样做?)。希望有帮助!如果事情仍然不清楚,请发表评论。

关于git - diff pathspec 是如何定义的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6404294/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com