致命:参考不是树:发展

时间:2016-02-17 04:47:38

标签: git gitlab

我们正在使用GitLab 6.2.1-0& Git 1.8.3 我试图接受从开发分支到prod分支的合并请求,GitLab UI不会让你接受合并请求。单击“接受合并请求”不会执行任何操作。深入挖掘,它只发生在一个项目中,开始出现“致命:引用不是树:”host.log错误

直到我们最近重新启动GitLab服务器

才开始工作
February 16, 2016 10:29 -> ERROR -> Command failed --git-dir=/opt/gitlab-6.2.1-0/apps/gitlab/gitlab-satellites/projectname/.git checkout develop    
fatal: reference is not a tree: develop
February 16, 2016 10:29 -> ERROR -> Command failed --git-dir=/opt/gitlab-6.2.1-0/apps/gitlab/gitlab-satellites/projectname/.git push origin prod
error: src refspec prod does not match any.
error: failed to push some refs to '/opt/gitlab-6.2.1-0/apps/gitlab/repositories/projectname.git'

导航到git项目目录,显示它当前在_parkingbranch,其中所有其他项目将显示开发分支

cd /opt/gitlab-6.2.1-0/apps/gitlab/gitlab-satellites/projectname
git status
# On branch __parking_branch
nothing to commit, working directory clean

我尝试将分支转换为开发,但没有帮助。

git checkout develop
fatal: reference is not a tree: develop

这发生在实际的git服务器本身而不是我的本地机器上。 任何指针都高度赞赏。

1 个答案:

答案 0 :(得分:0)

答案很晚,但我遇到了类似的问题。我试图在旧分支中进行拉动,但是同样的混乱被显示出来,所以我创建了一个本地临时分支,并使用原始分支进行了硬重置。然后我将temp分支重命名为原始名称。

简历中,这些是以下步骤:

  1. 创建本地分支

    git checkout -b temp

  2. 使用所需分支进行硬重置

    git reset --hard origin / branch-name

  3. 重命名临时分支

    git branch -m branch-name