Get error message ''fatal: sha1 information is lacking or useless“ when apply a patch using ”git am -3"

后端 未结 6 1028
别那么骄傲
别那么骄傲 2020-12-17 08:53

I am trying to apply a series of patches from 1 git repository to another git repository using git am -3 \"path to a patch\". I apply them in order, from patch 1-4, it works

6条回答
  •  一向
    一向 (楼主)
    2020-12-17 09:08

    Are you using submodules in your project?

    There was a bug in git 1.7.12 to 1.8.1.2 where an updated submodule would cause a rebase (or patch) to fail with the error message:

    fatal: sha1 information is lacking or useless

    leaving the commit empty if applied.

    More info here.

    Updating git to version 1.8.4 solves this problem

提交回复
热议问题