Getting rid of '… does not point to a valid object' for an old git branch

前端 未结 13 2010
不知归路
不知归路 2020-12-13 03:51

I have a fork of a Git repo and my clone appears to have an issue with an old, no longer existant, branch. I keep seeing this message:

error: refs/heads/t_1140

13条回答
  •  粉色の甜心
    2020-12-13 04:04

    Check .git/refs/remotes/origin. They are there and the upstream no longer has them. To clean out the remotes that no longer exist run

    git remote prune origin
    

    You could also see what it would to by adding --dry-run before actually doing it.

提交回复
热议问题