git fast-import --export-marks 标志
git fast-import --export-marks 能够导出将标记与其创建的提交哈希相关联的文件。
到目前为止,我看到的标记不是输入中提供的标记,而是一些与输入无关的“内部标记”。
如果保留原始标记,对于导入/导出互操作不是更好吗?
git fast-import --export-marks is able to export a file associating the marks with the commit hashes it created.
So far I've seen the marks are not the ones provided in the input but some "internal ones" not related with the input.
Wouldn't it be much better, for import/export interop, if it keeps the original marks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
fast-import
导出标记的目的是列出提交和 blob,以供后续验证和同步。fast-import
导入标记的目的是在增量导出-导入场景中跳过提交。您可以从上表中看到在存储库增量同步的场景中如何组合标志。人们可以导出一个存储库,将其导入到其他地方,然后通过跳过以前导出的提交来创建增量导出文件,或者通过跳过已知的提交来创建完整导出并增量导入。
这是一个简短的例子来说明。
仅导出了一个标记,即添加到存储库的单个提交的标记。
当您继续重新创建存储库时,导出的标记不仅会列出提交,还会列出新的 blob。这些新的 blob 已重新创建,并出现在标记中供您检查,还列出了提交以与所有导入引用的提交进行比较。
blob
:1
已重新创建,并在标记文件中新列出(使用第一个可用标记,恰好是:1
),但请注意标记的提交 < code>:2 保留了原始导出存储库中的标记和哈希值。The purpose of the marks exported by
fast-import
is to list the commits and the blobs for subsequent verification and synchronisation. The purpose of the marks imported byfast-import
is to skip commits in an incremental export-import scenario.You can see from the tables above how the flags might be combined in a scenario where repos are incrementally synchronised. One might export a repo, import it elsewhere, then either create incremental export files by skipping previously exported commits, or create full exports and incrementally import by skipping commits already known.
Here's a short example to clarify.
Only one mark has been exported, the mark for the single commit added to the repo.
When you proceed to recreate the repository, the exported marks will list not only the commits, but also the new blobs. These new blobs have been re-created, and are present in the marks for you to check, the commits are also listed to compare against all the import referenced commits.
The blob
:1
has been recreated and is newly listed in the marks file (using the first available mark which happens to be:1
), but note that the marked commit:2
retained its mark and its hash from the original exported repo.