Actions

Difference between revisions of "Patch Command"

From InfoTechPedia

(new page on patch)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Using patch cli command
+
This page shows how to use the patch command in CLI
  
 
Example using MediaWiki patch files to update minor versions of MediaWiki.
 
Example using MediaWiki patch files to update minor versions of MediaWiki.
Line 7: Line 7:
  
 
:cd to your main MediaWiki directory (the one with LocalSettings.php)
 
:cd to your main MediaWiki directory (the one with LocalSettings.php)
:Download the patch file and gunzip it.
+
:Download the patch file and gunzip it. <code>gunzip mediawiki-x.xx.x.patch.gz</code>
 
:Use patch <code>-p1 --dry-run</code> to check what will be changed (e.g., <code>patch -p1 --dry-run -i mediawiki-x.xx.x.patch</code>)
 
:Use patch <code>-p1 --dry-run</code> to check what will be changed (e.g., <code>patch -p1 --dry-run -i mediawiki-x.xx.x.patch</code>)
 
:If all is well, run patch again without --dry-run.
 
:If all is well, run patch again without --dry-run.
 
:Check your Special:Version and you should see the new version number in place.
 
:Check your Special:Version and you should see the new version number in place.
 +
 +
[[Category:Linux]][[Category:Command Line]]

Latest revision as of 07:56, 15 August 2020

This page shows how to use the patch command in CLI

Example using MediaWiki patch files to update minor versions of MediaWiki.

A small patch file is usually made available for a minor version upgrade. Manually download and extract the patch file from the dumps site or follow the directions with wget below. Patches are incremental, you can not skip a version.


cd to your main MediaWiki directory (the one with LocalSettings.php)
Download the patch file and gunzip it. gunzip mediawiki-x.xx.x.patch.gz
Use patch -p1 --dry-run to check what will be changed (e.g., patch -p1 --dry-run -i mediawiki-x.xx.x.patch)
If all is well, run patch again without --dry-run.
Check your Special:Version and you should see the new version number in place.