「管理者用Git」の版間の差分

提供:MoodleDocs
移動先:案内検索
21行目: 21行目:
== あなたのインストール済みMoodleを更新する ==
== あなたのインストール済みMoodleを更新する ==


The Moodle development team performs integration and testing of fixed bugs every Monday and Tuesday. On Wednesday you can install all patches by updating your code. Check the [http://git.moodle.org/gw?p=moodle.git;a=summary shortlog] to see if the official repository has been already updated or not.
Moodle開発チームは、バグ修正の統合およびテストを毎週月曜日および木曜日に実施しています。あなたのコードを更新するために、水曜日にすべてのパッチをインストールすることができます。公式リポジトリがすで更新されているかどうか、[http://git.moodle.org/gw?p=moodle.git;a=summary ショートログ]をご覧ください。


     cd /path/to/your/moodle/checkout
     cd /path/to/your/moodle/checkout

2011年9月15日 (木) 17:31時点における版

作成中です - Mitsuhiro Yoshida

あなたのMoodleサーバをメンテナンスするためのCVSの代わりとして、Gitを使用することができます。このページでは、あなたの実運用サイトでどのようにしてMoodleを管理するのか説明しています。Gitを使用することで、簡単にMoodleをアップグレードすることができます。あなたがMoodleのコアコードをカスタマイズしている場合、開発者用Git内のインストラクションに従ってください。

Gitからコードを取得する

あなたはオフィシャルMoodle gitリポジトリを git://git.moodle.org/moodle.git で見つけることができます (公式クローンは git://github.com/moodle/moodle.git にあります)。あなたのローカルチェックアウトを初期化するには:

   git clone git://git.moodle.org/moodle.git                       (1)
   cd moodle
   git branch -a                                                   (2)
   git branch --track local_19_STABLE origin/MOODLE_19_STABLE      (3)
   git checkout local_19_STABLE                                    (4)

コマンド (1) では、新しいローカルリポジトリをアップストリーム (upstream 上流) にあるmoodle.gitリポジトリのクローンとして初期化します。デフォルトでは、このアップストリームのリポジトリは「origin」リモートリポジトリとして知られることになります。コマンド (2) では、すべての利用可能なブランチを一覧表示します。コマンド (3) では、local_19_STABLEという名称の新しいローカルブランチを作成して、アップストリームリポジトリのブランチ「MOODLE_19_STABLE」を追跡 (track) するよう設定します。コマンド (4) では、新しく作成したブランチに実際にスイッチします。最後の2つのコマンドは、下記のコマンドに置き換えることができることに留意してください:

   git checkout -b local_19_STABLE origin/MOODLE_19_STABLE         (3 + 4)

このコマンドでは、新しいローカル追跡ブランチを作成して、そのブランチに即座にスイッチします。

あなたのインストール済みMoodleを更新する

Moodle開発チームは、バグ修正の統合およびテストを毎週月曜日および木曜日に実施しています。あなたのコードを更新するために、水曜日にすべてのパッチをインストールすることができます。公式リポジトリがすで更新されているかどうか、ショートログをご覧ください。

   cd /path/to/your/moodle/checkout
   git fetch                                                       (1)
   git status                                                      (2)
   git merge                                                       (3)

The command (1) downloads new updates from the remote repository without touching your local checkout. The command (2) displays the information about the eventual drift between you local version and the upstream one. The command (3) actually modifies your local files with the updates. The git-fetch + git-merge couple can be replaced with a single command

   git pull                                                        (1 + 3)

Gitリポジトリから投稿拡張モジュールをインストールする

For example, let us say we want to install the Book module form its Git repository into our Moodle 2.0.

   cd /path/to/your/moodle/checkout
   cd mod                                                          (1)
   git clone git://github.com/skodak/moodle-mod_book.git book      (2)
   cd book
   git checkout -b MOODLE_20_STABLE origin/MOODLE_20_STABLE        (3)
   git branch -d master                                            (4)

The command (1) changes the current directory into the mod folder of your local Moodle clone. The command (2) creates a new subdirectory book and makes a local clone of Petr Škoda's vanilla Book repository. The command (3) creates a new local branch that will track the remote branch with a Book version for Moodle 2.0. The command (4) deletes the master that was created automatically by git-clone in (2) as we do not want it in this production checkout.

Now it is wise to put the new directory mod/book/ to the list of ignored files of the main Moodle clone.

   cd /path/to/your/moodle/checkout
   echo /mod/book/ >> .git/info/exclude

To update your Moodle installation now, you must visit both Git repositories and pull changes from upstream.

   cd /path/to/your/moodle/checkout
   git pull
   cd /path/to/your/moodle/checkout/mod/book
   git pull

Writing a shell script with these lines in the root of Moodle installation is a very good idea. Otherwise it is easy to forget what Git repositories are there within the main Moodle repository.

関連情報

Moodle Docs
Moodle forum discussions
External resources