当通过--tag获取git引用时,";pload-pack:不是我们的引用是什么意思? [英] What does "upload-pack: not our ref" mean, when fetching git refs via --tags?
本文介绍了当通过--tag获取git引用时,";pload-pack:不是我们的引用是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的一个项目中,只要我的构建脚本尝试使用git fetch --tags
获取所有Git标记:
`` git fetch --tags --verbose
POST git-upload-pack (350 bytes)
POST git-upload-pack (788 bytes)
POST git-upload-pack (797 bytes)
From https://github.com/ELLIOTTCABLE/bs-sedlex
= [up to date] fix-ci -> origin/fix-ci
* [new tag] sedlex-1.99.2 -> sedlex-1.99.2
* [new tag] v1.99.3 -> v1.99.3
...
* [new tag] v20.0.0-pre.2 -> v20.0.0-pre.2
Fetching submodule ppx-sedlex
POST git-upload-pack (122 bytes)
From https://github.com/ELLIOTTCABLE/ppx-sedlex
= [up to date] develop -> origin/develop
= [up to date] master -> origin/master
...
= [up to date] v20.0.0-pre.2 -> v20.0.0-pre.2
POST git-upload-pack (4 bytes)
POST git-upload-pack (69 bytes)
POST git-upload-pack (586 bytes)
fatal: remote error: upload-pack: not our ref 0f509703fcd43ff4324d721a39220153bab49d4a
这尤其令人困惑,因为无论是主repobs-sedlex
还是git-子模块ppx-sedlex
,都没有像0f5097...
这样的提交;我不知道SHA从何而来。此故障仅在Linux工作器上发生,我不知道为什么--git fetch --tags
在同一个repo上可以在MacOS Travis-Worker上、在我的MacOS机器上以及在我为调试此程序而启动的Ubuntu Vagant机器上工作。
"FATAL:REMOTE ERROR:UPLOAD-PACK:NOT OUR REF"错误表示什么;我如何解决它?我甚至不确定从哪里开始调试这个错误,因为它只在Travis工人身上发生。
(不太可能有帮助,但这里是error in context和the repository in question。)
编辑1:以下是添加GIT_TRACE=2:
的一些其他有趣的输出Fetching submodule ppx-sedlex
23:55:28.125076 git.c:439 trace: built-in: git fetch --no-prune --no-prune-tags --tags -v --recurse-submodules-default on-demand --submodule-prefix ppx-sedlex/
23:55:28.125914 run-command.c:663 trace: run_command: git-remote-https origin https://github.com/ELLIOTTCABLE/ppx-sedlex.git
23:55:28.429609 run-command.c:663 trace: run_command: git rev-list --objects --stdin --not --all --quiet --alternate-refs
23:55:28.432485 run-command.c:663 trace: run_command: git rev-list --objects --stdin --not --all --quiet --alternate-refs
23:55:28.434082 git.c:439 trace: built-in: git rev-list --objects --stdin --not --all --quiet --alternate-refs
From https://github.com/ELLIOTTCABLE/ppx-sedlex
= [up to date] develop -> origin/develop
= [up to date] master -> origin/master
= [up to date] v1.99.4 -> v1.99.4
= [up to date] v1.99.4-pre.1 -> v1.99.4-pre.1
= [up to date] v1.99.4-pre.3 -> v1.99.4-pre.3
= [up to date] v1.99.4-pre.8 -> v1.99.4-pre.8
= [up to date] v2.0.0 -> v2.0.0
= [up to date] v20.0.0-pre.1 -> v20.0.0-pre.1
= [up to date] v20.0.0-pre.2 -> v20.0.0-pre.2
23:55:28.442482 run-command.c:1616 run_processes_parallel: preparing to run up to 1 tasks
23:55:28.442504 run-command.c:1648 run_processes_parallel: done
23:55:28.442536 run-command.c:663 trace: run_command: git gc --auto
23:55:28.443983 git.c:439 trace: built-in: git gc --auto
23:55:28.444903 run-command.c:663 trace: run_command: cd /home/vagrant/ELLIOTTCABLE/bs-sedlex/.git/modules/ppx-sedlex; unset GIT_PREFIX; GIT_DIR=. git fetch --no-prune --no-prune-tags --tags -v --recurse-submodules-default on-demand --submodule-prefix ppx-sedlex/ origin 0f509703fcd43ff4324d721a39220153bab49d4a
23:55:28.446392 git.c:439 trace: built-in: git fetch --no-prune --no-prune-tags --tags -v --recurse-submodules-default on-demand --submodule-prefix ppx-sedlex/ origin 0f509703fcd43ff4324d721a39220153bab49d4a
23:55:28.447105 run-command.c:663 trace: run_command: git-remote-https origin https://github.com/ELLIOTTCABLE/ppx-sedlex.git
23:55:28.735871 run-command.c:663 trace: run_command: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --no-progress https://github.com/ELLIOTTCABLE/ppx-sedlex.git/
23:55:28.738885 git.c:439 trace: built-in: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --no-progress https://github.com/ELLIOTTCABLE/ppx-sedlex.git/
error: Server does not allow request for unadvertised object 0f509703fcd43ff4324d721a39220153bab49d4a
我搞不懂为什么Git在这里请求一个"未公布的对象";但这显然不是GitHub的问题,在这里-出于某种原因,命令:
git fetch --no-prune --no-prune-tags --tags -v
--recurse-submodules-default on-demand
--submodule-prefix ppx-sedlex/
origin 0f509703fcd43ff4324d721a39220153bab49d4a
.当Igit fetch
在父repo中时,在子模块上自动调用。(同样,该提交0f509703
不存在于这两个repo中;同样,完全相同的repo、完全相同的提交,而且这并不是发生在MacOS上--仅在Travis的Linux计算机上。)
推荐答案
这尤其令人困惑,因为无论是主repo bs-sedlex还是git子模块ppx-sedlex,都没有像0f5097...;这样开始的任何提交
但它们可能have a tag with that SHA1(一旦取消引用,将指向提交)
致命:远程错误:Upload-Pack:不是我们的参考错误表示什么;
请参阅cloning a repo with nested submodules does not work
Git提供了三个选项来控制您是否可以获取任意对象ID:
- 允许获取Git有权访问的任何任意对象
- 允许从引用中获取任何可访问的对象,
- 还允许从隐藏引用中获取可访问的对象。
消息&NOT OUR REF&QOOT;表示您正在尝试按对象ID提取对象,该对象ID用于子模块,但服务器不允许。
在您的情况下,可能是:
- 子模块中的标签从未被推送
- 或(因为它从其他来源工作)Travis-CI无权访问子模块(private dependencies):请参阅";Git - Submodules in Travis CI ";。
或者它有该子模块的某个缓存版本。
这篇关于当通过--tag获取git引用时,";pload-pack:不是我们的引用是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文