Typo3 - Patch einspielen

Aus Wikizone
Wechseln zu: Navigation, Suche

Tipp[Bearbeiten]

Textmate kann das auch: Patchfile (.diff) in Textmate öffnen. Oben im Patchfile steht normalerweise auf welchen Pfad sich das Patch bezieht. Dann mit Bundles / Diff / Apply Patch to Files anwenden.

Creating a "diff"[Bearbeiten]

A "diff" is a file that contains just the differences between two files. Diffs are widely used for development because they allow easy reviewing of changes to the program code. There are various styles of diff output. It is important to know that for TYPO3 development we almost only use the "unified diff" (a diff variant that contains three lines of context before and after that part that was changed).

The opposite part of "diff" is "patch", a program that can apply changes from a diff file to the original code.

Here are the two most important commands:

Create a unified diff of two directories:

diff -ru typo3_src.orig/ typo3_src.new/ > bug_1234.diff

How to apply a patch

Patch your source code using a diff file:

cd typo3_src.new/ 
patch --dry-run -p1 < ../bug_1234.diff

(Use the --dry-run parameter to first check if the patch applies successfully. Run the same command again without this parameter to make the changes affect.)