Git refs/remotes/origin/master does not point to a valid object

后端 未结 2 1420
礼貌的吻别
礼貌的吻别 2021-01-31 03:42

After the last merge to the master branch of my Git repository I have lost the ability to clone repository.

Cloning into test-repository...
remote: Counting objects:          


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 04:14

    Typically you can do:

    git reflog master
    

    This will give you a list of the last know positions that master has pointed to.

    Once you know this you can create a temporary branch to an older version of master ie

    git branch temp master@{1}
    

    Then checkout temp and see if it is in proper order. If you don't see anything there then the commands that you did previously (delete the reflog, delete dangling commits, etc) have probably wiped out all ways to recovery.

提交回复
热议问题