Git 找不到远程参考...但我也不能



我对Git有一个奇怪的问题,在某个地方我引用了一个名为2013.rel25的旧分支,但我不知道它在哪里。这是一个很久以前在origin上合并并删除的分支。

C:project>git pull
fatal: Couldn't find remote ref refs/heads/2013.rel25
C:project>git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
C:project>git remote prune origin
C:project>git pull
fatal: Couldn't find remote ref refs/heads/2013.rel25

我如何才能找到引用这个既不存在于本地也不存在于远程的死分支的内容?然后,我如何删除或修复引用,以便返回到从原始主机/主机到本地主机的拉动?

EDIT:我的.git/config文件专门将其引用为获取头。我想我会手动删除它:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    url = git@github.com:somebody/project.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    fetch = refs/heads/2013.rel25:refs/remotes/origin/2013.rel25
[branch "master"]
    remote = origin
    merge = refs/heads/master

我找不到通过命令行删除它的方法,所以我只是在.git/config编辑了我的Git配置文件,并删除了这一行:

fetch = refs/heads/2013.rel25:refs/remotes/origin/2013.rel25

处理此问题的一种方法是从远程克隆项目,这样您就可以获得干净的文件而不会出现任何错误。

相关内容

最新更新