In my case, I have a file, it came long ago from a fork of something else. Tons of things have diverged. However, I notice a small change in another fork that I like. I want to use that code. I could just copy and paste and commit, but then it would look like I wrote it. I could add a comment in the commit about the original author, but that's not ideal.
In this case, all the code I want came from a single commit that had nothing else in it. I can't easily cherry-pick because my code is changed enough that all the lines are different. But what I want to do is get the exact lines from their commit with credit to them, and just merge in those select lines to a file in my code where they will be different line numbers in a longer file. Is this feasible?
Why don't you do whatever to compose the commit (probably apply patch from that other commit) and then when you commit locally, use the --author= < originalAuthor > flag and specify the original author's name, so the commit is attributed to them?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With