Skip to content

Instantly share code, notes, and snippets.

@1v
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1v/a9f1417d40bae5c8b9d4 to your computer and use it in GitHub Desktop.
Save 1v/a9f1417d40bae5c8b9d4 to your computer and use it in GitHub Desktop.
MediaWiki Git Installation

Install git:

sudo aptitude install git

Clone from repo (in site root path):

cd www/site.ru/
git clone -b REL1_23 https://gerrit.wikimedia.org/r/p/mediawiki/core.git ./

Clone MonoBook skin in skins folder:

cd www/site.ru/skins/
git clone https://git.wikimedia.org/git/mediawiki/skins/MonoBook.git

In the end of .htaccess add:

RedirectMatch 404 ^.*\.git.*$

Copy from old db to new (type pass two times):

mysqldump -u root -p -v db1 | mysql -u root -p db2

Copy extensions/ folder. Copy images/ except images/thumb/. Copy .htaccess from root folder. Copy favicon.ico, logo/ folder, robots.txt.

Run update script:

php maintenance/update.php

Rebuild search index:

php maintenance/rebuildtextindex.php

In .git/info/exclude (because .gitignore exists in MW repo :() add paths and files to exclude from git index and from untracked (will not showing in git status):

robots.txt
images/math/
logo/
webstat/

git update-index --assume-unchanged not working for new files :(

Extensions

$ cd extensions
$ git clone -b REL1_23 https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Math.git
$ cd extensions/Math/math
$ make
$ cd extensions/Math/texvccheck/
$ make

Output.

Add the following code at the bottom of your LocalSettings.php:

require_once("$IP/extensions/Math/Math.php");

Other

  1. Extension:CategoryTree
  2. Extension:Replace Text
  3. Extension:ParserFunctions
  4. Extension:UserMerge
  5. Extension:CharInsert
  6. Extension:Cite

Download updates but not apply:

git fetch origin

Watch changes (full):

git diff HEAD origin/REL1_23

Short:

git diff --stat HEAD origin/REL1_23

Apply changes:

git merge origin/REL1_23

Remove from index but not from disk:

git rm -r --cached file.txt

Information about commit:

git show --pretty=raw f02685a775e4

Switch to new branch (release):

# download changes
git fetch origin
# switch to new branch
git checkout -b REL1_24 origin/REL1_24

Revert file to master:

git checkout <filepath>

Or

git checkout origin/master <filepath>

Commits log:

git log

Revert commit:

git reset --soft HEAD~1

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment