Merge PHP changes with diff / patch

I have three PHP files:

  • 1.php - version 1.0 of the OSS software (vanilla)
  • 1a.php - Version 1.0 of the OSS software (with settings)
  • 2.php - Version 1.1 of the OSS software (vanilla)

I would like to use diff / patch (or similar) to create a single patch file that combines the changes I made in version 1.0 with the changes that occurred in version 1.1. What is the best way to achieve this?

Many thanks.

+5
source share
1 answer

Use this:

$ diff -u 1.php 1a.php > customizations.patch

This will give you a uniform spread of all changes between your vanilla and a personalized copy of version 1.0 of the file.

, 2.php, :

$ patch -p0 2.php customizations.patch

, , , , , . , diff , .

, , , . , , , . , , , , diff patch.

, ; , diff ( ) . , , , , .

+5

All Articles