如何解决"远程拒绝 - 未能锁定refs"错误信息?

时间:2017-02-22 14:25:10

标签: git github git-push

我是Github的新手,所以请耐心等待。我试图将新更新的分支从我的本地主存储库推送到远程主服务器。它已经成功地提交了分支但由于下面提到的错误消息而无法推送,我不确定为什么这是因为我之前从未遇到过推送分支的问题。我尝试了一些现有的解决方案,大多数都使用不同的命令行,但它们仍然无法正常工作。我仍然试图弄清楚问题是什么,为什么会出现这个问题以及如何解决它。

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --set-upstream origin refs/heads/master/Homepage-2017:refs/heads/master/Homepage-2017 
Pushing to https://jdoe@stash.example.org/scm/mfb/stash-web.git
error: packfile .git/objects/pack/pack-4b09cd59c424999f5712f1ea23f3198ce0b2bfb6.pack does not match index
POST git-receive-pack (532839 bytes)
remote: error: failed to lock refs/heads/master/Homepage-2017        
To https://jdoe@stash.example.org/scm/mfb/stash-web.git
 ! [remote rejected] master/Homepage-2017 -> master/Homepage-2017 (failed to lock)
error: failed to push some refs to 'https://jdoe@stash.example.org/scm/mfb/stash-web.git'
Completed with errors, see above

1 个答案:

答案 0 :(得分:0)

我只是遇到这样的问题,问题不在于层次结构,而在于远程目录bugs /,例如,大写字母B,Bugs /。一旦指定了远程分支名称以反映正确的名称,我就很好了。我使用的git客户端Sourcetree不会将分支名称区分大小写,因此请注意这一点。