gpt4 book ai didi

git - 臭名昭著的 Git 错误 : remote rejected (failed to lock)

转载 作者:IT王子 更新时间:2023-10-29 01:08:45 25 4
gpt4 key购买 nike

我正在尝试从我的本地推送到一个分支到原点。分支名称和路径相同。我已经从这个分支推 pull 了一段时间,从来没有遇到过问题。但突然间,它开始表现得很糟糕。上次我尝试使用以下命令推送到原点时:

git push origin feature/Prizefulfilment

它给我以下错误:

72c6c1da98e5cff4484e254a538d9e3b472156ff but expected 0000000000000000000000000000000000000000

我用 Google 搜索了一下,但还没有找到一个非常令人满意的解决方案。

我的确切错误如下所示:

$ git push origin feature/Prizefulfilment
Counting objects: 126, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (75/75), done.
Writing objects: 100% (78/78), 8.83 KiB, done.
Total 78 (delta 61), reused 0 (delta 0)
error: Ref refs/heads/feature/Prizefulfilment is at 72c6c1da98e5cff4484e254a538d9e3b472156ff but expected 0000000000000000000000000000000000000000
remote: error: failed to lock refs/heads/feature/Prizefulfilment
To git@devtools.contestfactory.com:OpusOneSCRUM
! [remote rejected] feature/Prizefulfilment -> feature/Prizefulfilment (failed to lock)
error: failed to push some refs to 'git@devtools.contestfactory.com:OpusOneSCRUM'`

有什么想法吗?

最佳答案

 git push feature/prizeFulfilment: feature/Prizefulfilment

类似于this answer :

For the record, I believe the root cause of this problem was the difference in capitalisation between the local and remote branch names, and the case-insensitive nature of the Windows share that hosted the remote repository.

We just encountered this exact same error and were able to resolve the problem simply by renaming the local branch to match the capitalisation of the existing remote branch.

尝试并确保在本地和远程分支机构之间使用相同的大小写

你的第二个命令使 prizeFulfilment 和远程 Prizefulfilment 之间的链接显式,这就是它起作用的原因。但是,保留具有这种差异的本地分支机构并不是一个好的解决方案。

关于git - 臭名昭著的 Git 错误 : remote rejected (failed to lock),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12416643/

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