How to cherry pick only changes for only one file, not the whole commit

后端 未结 9 1354
萌比男神i
萌比男神i 2020-12-04 07:12

I need to apply changes introduced in one branch to another branch. I can use cherry pick to do that. However, in my case I want to apply changes which are relevant only for

9条回答
  •  天涯浪人
    2020-12-04 07:21

    You can try doing this:

    git show COMMIT_ID -- path/to/specific-file | git apply
    

    For example:

    git show 3feaf20 -- app/views/home/index.html | git apply
    

提交回复
热议问题