cherry-pick a commit and keep original SHA code

前端 未结 5 527
孤独总比滥情好
孤独总比滥情好 2021-02-02 05:41

I would like to cherry-pick a commit on a fetched remote while keeping it\'s original SHA commit code (my current branch is based on this remote which I resetted to a previous s

5条回答
  •  孤街浪徒
    2021-02-02 05:58

    The SHA commit hash is made of from the state of the repository, using the whole history up to the point of the commit (branches not included). This means that you cannot keep the original hash on cherry-picking unless the whole history is the same, and in that case cherry-picking would make no sense.

提交回复
热议问题