fatal: bad object xxx

前端 未结 12 2095
[愿得一人]
[愿得一人] 2021-02-03 17:00

I tried reverting to a previous git commit with:

git revert xxx

I\'m now receiving this error as a response:

fatal: bad object          


        
12条回答
  •  臣服心动
    2021-02-03 17:54

    I just ran into the same error (bad object [hash]) while attempting to merge from a branch my client didn't know about. (Similar to PrzeoR's case, but instead of needing a pull I needed to fetch)

    In my case I needed to run git fetch to re-sync my client to the state of the server. Posting this here in case anyone reaches this thread the same way I did and could benefit from this insight.

    git pull
    git cherry-pick [hash]
    fatal: bad object [hash]
    git fetch
    remote: Counting objects: 8, done. (etc.)
    From github.com:repo/branch
     * [new branch] branchname
    
    git cherry-pick [hash]
    [success]
    

提交回复
热议问题