SVN から Git への移行

This page is a translated version of the page Migrating from SVN to Git and the translation is 100% complete.

SVNによるWikiの開発あるいは製作を終了してGitへ移行を検討している場合を対象にします。

コア (旧称"phase3")

現状ではテスト前であり、いわゆる試案段階です!

ご利用のウィキが/var/www上にあり、ウィキファイルを「w」ディレクトリに配置してあるという前提で解説します。

  1. Make a backup of your files (doing your database aswell wouldn't be a bad thing)! If you want to keep any changes you've made to mediawiki code, save the results of
    svn diff
    .
  2. Strip out all the old .svn folders (though, we possibly don't want to delete the ones from the extensions. Hmmm)
    cd /var/www
    find ./w -name ".svn" -type d -exec rm -rf {} \;
    
  3. Do a Git clone into a new folder
    Anonymous:
    git clone https://gerrit.wikimedia.org/r/mediawiki/core.git git
    Wikimedia developer account:
    git clone ssh://<USERNAME>@gerrit.wikimedia.org:29418/mediawiki/core.git git
  4. Change this Git clone to the wanted version
    cd git
    
    To make your Git clone use a branch:
    git checkout origin/REL1_18
    To make your Git clone use a tag:
    git checkout 1.18.2
  5. Copy this git clone over your SVN files
    cd ..
    cp -ra git/. w/
    
  6. Party!

今後の更新

セキュリティ更新や新規リリースその他を実行するために、更新作業を行う必要がある場合を解説します。 Gitからのダウンロード#別のバージョンへの切り替え を参照

拡張機能の移行

拡張機能には、Git に移動されたものとまだ Subversion にあるものがあります。 現状はそうなっており、将来的には解消される予定です。 Wikimedia Clusterで実装する拡張機能はすべて、さらに作者の要望に従いその他の拡張機能も移動済みです。

拡張機能の移動もコア (phase3) の移動と同等のプロセスを経ます。

関連項目