- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
git fast-import --export-marks 能够导出将标记与其创建的提交哈希相关联的文件。
到目前为止,我看到的标记不是输入中提供的标记,而是一些与输入无关的“内部标记”。
如果它保留原始标记,对于导入/导出互操作来说不是更好吗?
最佳答案
fast-import
标记exported 的目的是列出提交和 blob,以供后续验证和同步。 fast-import
标记imported 的目的是在增量导出-导入场景中跳过提交。
╔════════════════╦══════════════════════════════════╗║ ║ git fast-export ║╠════════════════╬══════════════════════════════════╣║ --import-marks ║ 1) commits to skip during export ║║ --export-marks ║ 2) exported commits ║╚════════════════╩══════════════════════════════════╝╔════════════════╦══════════════════════════════════════╗║ ║ git fast-import ║╠════════════════╬══════════════════════════════════════╣║ --import-marks ║ 3) commits to skip during import ║║ --export-marks ║ 4) a) blobs ║║ ║ b) imported commits, same as (2) ║╚════════════════╩══════════════════════════════════════╝
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.
$ cd /tmp && git init example && cd example && touch README && \
git add README && git commit -m "first commit"
$ git fast-export --all --export-marks=/tmp/example-repo.marks > /tmp/example-repo.export
--- /tmp/example-repo.export ---
blob
mark :1
...
reset refs/heads/master
commit refs/heads/master
mark :2
...
reset refs/heads/master
from :2
--- /tmp/example-repo.marks ---
:2 610432e74c554d783ff5f9edd1bb18548d68e533
只导出了一个标记,添加到 repo 的单个提交的标记。
$ git show 610432e74c554d783ff5f9edd1bb18548d68e533
commit 610432e74c554d783ff5f9edd1bb18548d68e533
...
当您继续重新创建存储库时,导出的标记不仅会列出提交,还会列出新的 blob。这些新的 blob 已重新创建,并出现在标记中供您检查,还列出了提交以与所有导入引用的提交进行比较。
$ cd /tmp && git init example-import && cd example-import && \
cat /tmp/example-repo.export | git fast-import --export-marks=/tmp/example-import-repo.marks
--- /tmp/example-import-repo.marks ---
:1 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
:2 610432e74c554d783ff5f9edd1bb18548d68e533
blob :1
已重新创建并在标记文件中新列出(使用恰好是 :1
的第一个可用标记),但请注意marked commit :2
保留了它的标记和来自原始导出 repo 的哈希。
关于git fast-import --export-marks 标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5451634/
我刚刚通过更改 import * as CodeMirror 修复了一个错误简单明了import CodeMirror . 我复制了this code . (从 TypeScript 移植) impo
我调试(在 PyCharm 中)一个脚本。我在断点处停止,然后转到调试控制台窗口,然后从那里调用导入行,如下所示: import my_util1 from my_utils 然后我调用 my_uti
谁能给我解释一下 import 语句是如何工作的? 例如,我在 myapp/app/models 包中有一个类型 User: package models type User struct {
我想导入 Control.App进入一个引用 PrimIO.PrimIO 的模块通过不合格的名称 PrimIO在很多地方。当然,问题在于 Control.App还导出一个名为 PrimIO 的定义.我
我应该使用 from foo import bar 或者 import foo.bar as bar 当导入模块 还有无需/希望更改名称 (bar)? 有什么不同吗?有关系吗? 最佳答案 假设 bar
我正在 Windows 上使用 Theano 进行深度学习实验的第一步,我很惊讶仅仅加载库需要多少时间。 这是小测试程序: from time import time t0 = time() impo
在 TypeScript 中,如何在不创建任何别名的情况下从文件“导入 *”? 例如我有一个包含顶级导出函数的文件“utils”,我想导入所有这些函数而不为每个函数重新创建别名。 像这样: impor
我应该使用 from foo import bar 或 import foo.bar as bar 当导入模块并且不需要/希望更改名称(bar)? 有什么不同吗?有关系吗? 最佳答案 假设bar是fo
这个问题在这里已经有了答案: Use 'import module' or 'from module import'? (23 个回答) 关闭8年前。 我想知道代码片段之间是否有任何区别 from u
我试过了 from urllib import request mine = request.Request() 和 import urllib.request mine = urllib.reque
所以,我有一个关于 Python 导入的小谜团。我确信出于某种原因事情应该是这样的,因为 Guido 很少出错。但是,为什么会这样呢? $ cat myModule.py #!/usr/bin/pyt
我们正在将 Rails 3.2 应用程序升级到 Rails 4.0。 我们有一个 assets/stylesheets/application/index.css.sass加载一些其他 sass 文件
我正在开发一个相当小的 Typescript 代码库,该代码库已经足够大,可以拆分到多个文件中。这是一个二十一点游戏。我目前有一堆代码,看起来像: var player = new Player();
是否可以以当模块为 use 时的方式编写模块? d 没有显式导入所有子例程都被导入,当它是 use d 显式导入只有这些显式导入的子程序可用? #!/usr/bin/env perl6 use v6;
这个问题在这里已经有了答案: how to watch changes in whole directory/folder containing many sass files (9 个回答) 5年前
我真的很难让它在 xcode 4 中工作。 我有一个项目将在许多应用程序(网络)中重用,因此我创建一个工作区并添加我的两个项目。到目前为止,一切都很好....这就是失败的地方.. #import "J
经典提取器和新提取器之间的主要区别是什么,哪个最好用? 最佳答案 经典提取器使用原始工作流程,与爬虫和连接器相同。 新的提取器更加精简,通常看起来和感觉都更好,并且经典提取器中的许多小错误已在新提取器
在处理 google webfont import mixin 时,我注意到无法动态构建 @import URL。 .gFontImport (@name, @weights, @subsets) {
我正在关注Django 1.8 tutorial 。在我的项目中mysite ,有一个源文件夹polls 。文件夹中有views.py模块其中 index函数已定义。还有一个urls.py文件: fr
我想使用名为 warp 的第三方库编译一个简单的 Rust 程序: [package] name = "hello-world-warp" version = "0.1.0" [dependencie
我是一名优秀的程序员,十分优秀!