尝试创建两次提交之间的git bundle时出错 [英] Error trying to create a git bundle ranged between 2 commits

查看:105
本文介绍了尝试创建两次提交之间的git bundle时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个从提交x到提交y的捆绑文件. 如 git bundle的文档中所指定,参数必须为" git可接受" rev-parse和git rev-list ...,用于指定要传输的特定对象和引用" 但是,当我运行以下命令时:

I am trying to create a bundle file from commit x to commit y. As specified on git bundle's documentation the arguments have to be "acceptable to git rev-parse and git rev-list ..., that specifies the specific objects and references to transport" However, when I run the following command:

git bundle create test.bundle 15b423..6cffeab

我收到错误

error: Refusing to create empty bundle.

然后我验证了rev-list和rev-parse可以引用这些提交:

Then I verified that the commits could be referenced by rev-list and rev-parse:

ana@DESKTOP-K400GGC MINGW64 ~/Projects/TEST1 ((20dc3fd...))
$ git rev-list 15b423b 6cffeab
6cffeabc7e3183fcca8cb8b91eecbf9e0af5a0e7
beb6fb7cfda467433cb2cdab362a25178b1ddf18
458cfcd0064b229f8b416d65405f18732d8c359a
53c90498e13edd32248842b3fd4fb7819041a1d6
ba087013804d4a39b36f3e679548fb45fe9645fb
ad1b1fde27be98b5b09d8e5a43137d16fd6e1840
540da9dea1b816a20be11e5c53b94467449266af
aa64d78ab5c990b047711b9f81fdae13beb27a05
15b423b91a63c403fe0ee0f3365c9846f37f3aa4

ana@DESKTOP-K400GGC MINGW64 ~/Projects/TEST1 ((20dc3fd...))
$ git rev-parse 15b423..6cffeab
6cffeabc7e3183fcca8cb8b91eecbf9e0af5a0e7
^15b423b91a63c403fe0ee0f3365c9846f37f3aa4

为什么不起作用?如何创建从提交 A 到提交 B 的捆绑文件?

Why it doesn't work? How can I create a bundle file that ranges from commit A to commit B ?

推荐答案

来自git bundle文档(在指定引用"下): "git bundle将仅打包由git show-ref显示的引用:这包括标题,标签和远程标题."因此,如果您在这些提交中添加了标签,则您的命令应该可以使用.

From git bundle documentation (under Specifying References): "git bundle will only package references that are shown by git show-ref: this includes heads, tags, and remote heads." So if you added tags to those commits, your command should work.

我确实同意您引用的行使其看起来像您的命令将起作用,恕我直言,这不是很清楚.

I do agree that the line that you quoted makes it seem like your command would work, IMHO that's not very clear.

这篇关于尝试创建两次提交之间的git bundle时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆