This assumes 2 copies of the PHP documentation repo, one "official" SVN which is meant to be kept clean, and a fork of php/doc-en
After the doc PR has been reviewed/approved/decided to merge, squash it into one commit (make sure the branch is up to date with upstream).
For the purpose of this tutorial, the following file structure is assumed:
|
|-- doc-en the Git fork
| |(content of English documentation)
|
|-- phpdoc-en (can be any language)
| -- en
Update the SVN repo by running svn update
to prevent merge conflicts later down the line
Use the following command git diff --no-prefix HEAD^ HEAD > patch-file.diff
Note: HEAD
can be replaced by the commit hash.
Move into the SVN repo under then en
folder (or other language if working on a translation), i.e. cd ../phpdoc-en/en
and execute the following command: patch -p0 < ../../doc-en/patch-file.diff
Note: files need to be deleted and added manually to SVN by using:
svn add file
and svn delete file
as it is not supported by the patch command, it will show as a reject file.
Double check the status by running svn status
if happy use the follwing command: svn commit --include-externals -m "Commit message"