I'm trying to apply some changes made in a specific commit onto the HEAD of my Git repository. The branch this commit was made in is almost two years old and was never merged into the main branch of the repository for a few reasons.
However, there are a few changes made in that commit that I'd like to port over, in particular the additions made to two files: a method signature that was added to a Java interface and its implementation in the concrete class. No lines were changed or removed those two files.
My problem is, if I try to merge or cherry-pick this commit onto my current branch, I get all sorts of conflicts, since the commit is so old. Even in those two files, a lot of code has been changed in the meantime, and now Git asks me if I want the lines in that commit or the lines that have been added in the past two years. What I'd actually like is if Git could just replay on the HEAD the same additions that were made in that commit, without replacing any content.
In this particular instance, being only two files, I can port over the changes manually, but I was wondering if I was missing a specific Git command/option that could automatically fix analogous situations.