I have two files:
master/newsletter1/file.html
master/newsletter2/file.html
newsletter1/file.html has a lot of new changes that I want to merge into newsletter2/file.html. How can I achieve this? Everything I have read seems to resolve around merging between branches, but these are in the same branch :/
I would recommend using a third-party diff tool of your choice, in order to do a manual merge between the two files.
This is not about source-control (ie managing the history of versions for one file).
This is about reporting changes from one files to another (the source-control tool will then pick up the new version for the second file).
As Jefromi mentions in the comments, and as he explains in "run git merge algorithm on two individual files", git merge-file
can actually merge two different files, provided a common ancestor is provided.
git merge-file <current-version> <common-ancestor> <other-version>
In your case, you could try with the common ancestor being identical to the current file.
git merge-file master/newsletter2/file.html master/newsletter1/file.html master/newsletter2/file.html
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