How would I best phrase the WordPress question below? The question I have composed is flagged by Stack Exchange as, "The question you're asking appears subjective and is likely to be closed." The title and text are below:
Title
"When copying a theme file to my child theme for edits, how do I best handle future theme updates?"
Question
I need to make a customization to my theme, and the best way to do so seems to be to edit a theme template (i.e. copy the template from parent theme to child theme, then edit the child theme template). I know this is not uncommon practice. But what is best practice when doing so, especially when the template in-question is updated?
I ask because the issue with this technique is: when the theme is updated, and this particular template is updated, I have to take extra steps to incorporate my edits into the new theme file. I'm not saying my template will be overwritten--I'm saying I will continue to use the old version of the template. How do I best use the new version of the template, that contains all the edits I made to the old version? My current method is to compare the two files using a diff-tool, and manually incorporate my edits into the new template. But that can be quite a bit time consuming for more extensive edits. And if another developer works on the site in the future, unless I've handed over very detailed notes, updating the theme could cause big issues for that developer that they'll have to painstakingly track down (I recently worked on a site with this problem). I'm just wondering if there is a better way that I am perhaps overlooking.
Ideally I make edits via my child theme's style.css or functions.php. If those aren't possible, for smaller edits, I sometimes write custom JavaScript. But the edits in this case will almost certainly have to be made to one (or more) theme PHP templates.