Can I interactively pick hunks from another git commit?

后端 未结 4 1048
梦谈多话
梦谈多话 2021-02-01 16:50

I\'m looking for exactly the same behavior as

git add -i -p

But instead of composing a commit from my working directory, I\'d like to compose

4条回答
  •  萌比男神i
    2021-02-01 17:29

    Using cherry-pick -n is not really satisfactory, since it leaves me with the dirty job of removing all the unrequired code. I'd really just like to pick the selected changes I want to test.

    The job may have been a dirty one before, but with the advent of git checkout --patch, you can now selectively discard changes, similar to git add -p for adding.

提交回复
热议问题