我试图将修补程序部署到我的临时服务器 (DigitalOcean),但收到“无法锁定引用”错误。我之前偶然发现了这个错误。我有一个分支“hotfix”,然后创建了“hotfix/some-hotfix”分支,当我尝试将其推送到原点时,我收到了错误。我通过删除存储库(BitBucket)中的分支“hotfix”来修复它。但现在我在临时服务器上部署时得到了它。
堆栈跟踪:
SSHKit::Command::Failed: git exit status: 1
git stdout: Fetching origin
error: cannot lock ref 'refs/heads/hotfix/my-hotfix-branch-name': 'refs/heads/hotfix' exists; cannot create 'refs/heads/hotfix/my-hotfix-branch-name'
From bitbucket.org:username/repo-name
! [new branch] hotfix/my-hotfix-branch-name -> hotfix/my-hotfix-branch-name (unable to update local ref)
error: some local refs could not be updated; try running
'git remote prune origin' to remove any old, conflicting branches
error: Could not fetch origin
git stderr: Nothing written
Run Code Online (Sandbox Code Playgroud)
我尝试跑步,git remote prune origin但没有帮助。我在这里没有任何想法