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

前端 未结 13 2036
不知归路
不知归路 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:24

    Your local clone is probably fine, the problem is that the t_1140 branch objects are missing from your GitHub repository.

    I had this problem too and GitHub support fixed it, I think by deleting refs/heads/t_1140 on their end.

    Update: I got the error again with another branch and I was able to fix it by running this command:

    git push origin :refs/heads/t_ispn982_master
    

    You should get a warning message like this:

    remote: warning: Allowing deletion of corrupt ref.
    

    but the corrupted branch will be deleted

提交回复
热议问题