Brad
Brad

Reputation: 163282

Git couldn't find remote ref... but I can't either

I have an odd problem with Git where somewhere I have some reference to an old branch called 2013.rel25, but I have no idea where it is. This is a branch that was merged and deleted on origin long ago.

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

How can I find out what is referencing this dead branch that exists neither locally, or on the remote? And then, how can I remove or fix the reference so I can go back to pulling from origin/master to local master?

EDIT: My .git/config file references it specifically as a fetch head. I guess I'll just remove it manually:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    url = [email protected]: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

Upvotes: 2

Views: 15259

Answers (2)

Santosh Parihar
Santosh Parihar

Reputation: 11

One of way to deal with this problem is to clone the project from remote and you will have Clean files without any errors.

Upvotes: -1

Brad
Brad

Reputation: 163282

I couldn't find a way to remove this via the command line, so I just edited my Git config file at .git/config and removed this line:

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

Upvotes: 11

Related Questions