Cherry-picking changes from a file to a different file

0 0
Read Time:23 Second

I have a file.
I have another file on a different path on a different branch with mostly the same content.
I have changes in my first file.
I want to move these changes to my second file.
The files have the same name, only the path differs.
(I also need to ignore changes in whitespace, because consistency.)

Solution:

git show SHA_HASH --relative=original/path/ -- original//path/file.name | git apply --directory=new/path/ --ignore-space-change -

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published. Required fields are marked *