How to change the SHA-1 of a specific commit in place with git?

前端 未结 3 1947
小鲜肉
小鲜肉 2021-01-25 20:36

The target commit may have parents and descendants.

it needs to replace the old commit in place,

so it\'s not as simple as cherry c

3条回答
  •  旧时难觅i
    2021-01-25 21:19

    No, you can't do that.

    The point of SHA-1 is to prevent changes like these. The whole git architecture depends on the assumption that SHA-1 uniquely identify the object in all git repository. No way to workaround this (not without redesigning everything, that is).

    The details are explained in the Git Magic book.

提交回复
热议问题