Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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
like image 655
Brad Avatar asked Jan 24 '26 02:01

Brad


1 Answers

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
like image 191
Brad Avatar answered Jan 25 '26 18:01

Brad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!