gpt4 book ai didi

windows - Git pull 无法更新本地引用

转载 作者:行者123 更新时间:2023-12-05 01:13:41 30 4
gpt4 key购买 nike

自从我们开始为 git 使用子模块以来,我有一些奇怪的事情。 我在 Windows 10 上并使用 Tortoise git 或 Powershell 或 cmd 或 Linux 命令解释器。

每当我尝试 pull 一个子模块时,我都会得到这样的结果:

PS
D:\repositories\git\ProjectAlice\ProjectAliceSkills\PublishedSkills\AliceCore>
git pull error: cannot lock ref 'refs/tags/1.0.35>=1.0.0-a4': Unable
to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.35>=1.0.0-a4.lock':
Invalid argument From
https://github.com/project-alice-assistant/skill_AliceCore ! [new
tag] 1.0.35>=1.0.0-a4 -> 1.0.35>=1.0.0-a4 (unable to update
local ref) error: cannot lock ref 'refs/tags/1.0.36>=1.0.0-a5': Unable
to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.36>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.36>=1.0.0-a5 ->
1.0.36>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.37>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.37>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.37>=1.0.0-a5 ->
1.0.37>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.38>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.38>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.38>=1.0.0-a5 ->
1.0.38>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.39>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.39>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.39>=1.0.0-a5 ->
1.0.39>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.40>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.40>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.40>=1.0.0-a5 ->
1.0.40>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.42>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.42>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.42>=1.0.0-a5 ->
1.0.42>=1.0.0-a5 (unable to update local ref) PS D:\repositories\git\ProjectAlice\ProjectAliceSkills\PublishedSkills\AliceCore>
git pull error: cannot lock ref 'refs/tags/1.0.35>=1.0.0-a4': Unable
to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.35>=1.0.0-a4.lock':
Invalid argument From
https://github.com/project-alice-assistant/skill_AliceCore ! [new
tag] 1.0.35>=1.0.0-a4 -> 1.0.35>=1.0.0-a4 (unable to update
local ref) error: cannot lock ref 'refs/tags/1.0.36>=1.0.0-a5': Unable
to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.36>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.36>=1.0.0-a5 ->
1.0.36>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.37>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.37>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.37>=1.0.0-a5 ->
1.0.37>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.38>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.38>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.38>=1.0.0-a5 ->
1.0.38>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.39>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.39>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.39>=1.0.0-a5 ->
1.0.39>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.40>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.40>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.40>=1.0.0-a5 ->
1.0.40>=1.0.0-a5 (unable to update local ref) error: cannot lock ref 'refs/tags/1.0.42>=1.0.0-a5': Unable to create
'D:/repositories/git/ProjectAlice/ProjectAliceSkills/.git/modules/PublishedSkills/skill_AliceCore/refs/tags/1.0.42>=1.0.0-a5.lock':
Invalid argument ! [new tag] 1.0.42>=1.0.0-a5 ->
1.0.42>=1.0.0-a5 (unable to update local ref)

所以,与锁定引用有关。令人恼火的一点是,当我通过 Linux 命令解释器执行相同的 git pull 时,好吧,它正常工作......其中 Tortoise git、cmd 或 Powershell 因上述错误而失败。

为了确定,我今天确实更新了 git,我确实尝试了我在该问题上发现的所有修剪建议,但没有任何解决办法。好吧,然后他们说使用 Linux 命令解释器!好吧,不幸的是,有很多子模块....

最佳答案

问题很可能是标签的名称:

 ! [new tag] 1.0.35>=1.0.0-a4 -> 1.0.35>=1.0.0-a4

这表明,在他们的计算机上(毫无疑问运行的是 Linux),他们有一个名为 1.0.35>=1.0.0-a4 的 Git 标签。 . 您的 在您的计算机上运行的 Git 决定创建一个同名的标签。 (这是标签背后的基本思想:与 branch 名称不同,每个人都应该共享相同的名称。因此,如果他们在他们的 Git 中创建标签 X,您的 Git 将复制该标签,并且它的存储的哈希 ID,到你的 Git,也称它为 X 。将此与分支名称进行比较:如果他们创建一个名为 X分支,你的 Git 将重命名这个并将其命名为 origin/X 。)

为此,您的 Git 会尝试使用此字符串作为文件名的一部分来创建本地文件系统文件。您的计算机出于某种原因拒绝这样做——可能拒绝了 >特点。见 Bret Cameron's answerWhat characters are forbidden in Windows and Linux directory names?

一个解决方案是告诉您的 Git 不要完全尝试复制它们的标签:添加 --no-tags给您的git fetchgit pull命令。更好的方法是让您的同事/同事停止在任何名称中使用此类字符。

关于windows - Git pull 无法更新本地引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60029690/

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