I have got some kind of software in version 1.2.0 (lets call it 120), my colleagues made changes in this software (they created custom module for this software by changing source code of software) lets call it 120-fr version. Since then software vendor made changes in software and most recent version of software is 1.2.6 now. My task is to migrate custom module from version 1.2.0-fr to 1.2.6 (software is made in Java btw.) and I've got original source code from 1.2.0 version.

What I made since now: 1. I've created diff between 1.2.0 and 1.2.0-fr by:

$: diff 1.2.0/ 1.2.0-fr/ > patch-120-fr.patch
$: cat patch-120-fr.patch | wc -l
> 407
  1. I created diff between 1.2.0 and 1.2.6:

    $: diff 1.2.0/ 1.2.6/ > patch-120-126.patch

    $: cat patch-120-126.patch | wc -l


So now (as I understand) I've got in first file changes that my colleagues made in source and in second file I've got changes between vendor versions. My question is how can I do diff between those files to append custom module to version 1.2.6 but without moving to much things from version 1.2.0? I've tried to do interdiff but with no luck.


Is there any reason not to use git? It is really good at merging changes like these automatically, and is exactly what it's made for. This isn't directly an answer to the question, but an alternative solution. Using git instead of diff, it would look something like this:

  # copy your original code to a new folder
cp -r 1.2.0 mysoftware_git
cd mysoftware_git/
  # make the original source code a git repository
git init
  # add everything to the repo
git add --all
  # make your first commit
git commit -m 'original source code'

  # make a branch for your colleagues' work:
git checkout -b 1.2.0-fr
  # overwrite the source with the appropriate changes
cp ../1.2.0-fr/* .
  # update and commit
git add --all
git commit -m 'new stuff written by Alice and Bob'

  # switch back to the master branch
git checkout master
  # add the 1.2.6 updates to the master
cp ../1.2.6/* .
git add --all
git commit -m 'Changes to the main software branch'

  # merge the changes from 1.2.0-fr into 1.2.6
git merge 1.2.6-fr

There might be some conflict resolution to do manually, but those are the basics of git branch and merge...

More details can be found here

  • I didnt think about using git, I will wait for other answers, but thanks for alternate solution! +1 – Krystian Jan 25 '16 at 5:12

Your Answer

