Title: パッチの提出
Author: Aki Hamano
Published: 2023年10月6日
Last modified: 2023年10月8日

---

# パッチの提出

## この投稿内

 * [概要](https://ja.wordpress.org/team/handbook/core/tutorials/trac/submitting-a-patch/?output_format=md#%e6%a6%82%e8%a6%81)
    - [Windows](https://ja.wordpress.org/team/handbook/core/tutorials/trac/submitting-a-patch/?output_format=md#windows)
    - [Mac/Linux コマンドライン](https://ja.wordpress.org/team/handbook/core/tutorials/trac/submitting-a-patch/?output_format=md#mac-linux-%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%83%a9%e3%82%a4%e3%83%b3)
 * [GitHub のフォークを WP trunk のコピーに追加する](https://ja.wordpress.org/team/handbook/core/tutorials/trac/submitting-a-patch/?output_format=md#github-%e3%81%ae%e3%83%95%e3%82%a9%e3%83%bc%e3%82%af%e3%82%92-wp-trunk-%e3%81%ae%e3%82%b3%e3%83%94%e3%83%bc%e3%81%ab%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b)

[↑ ページの先頭へ戻る](https://ja.wordpress.org/team/handbook/core/tutorials/trac/submitting-a-patch/?output_format=md#wp--skip-link--target)

## 󠀁[概要](https://ja.wordpress.org/team/handbook/core/tutorials/trac/submitting-a-patch/?output_format=md#%e6%a6%82%e8%a6%81)󠁿

ファイルを編集してテストしたら、パッチを作成して対応する Trac チケットにアップロード
し、他の人が変更点を見たりテストしたりできるようにする必要があります。「パッチ」
はさまざまな方法で作成できます。

IDE や Subversion クライアントを使用している場合、パッチはアプリケーションから直接
作成できます。パッチはルートディレクトリ (`/src` ディレクトリ、`wp-config-sample.
php` ファイルなどを含むフォルダー) から作成する必要があります。

### 󠀁[Windows](https://ja.wordpress.org/team/handbook/core/tutorials/trac/submitting-a-patch/?output_format=md#windows)󠁿

**Windows の場合、** [Tortoise SVN](http://tortoisesvn.net/) の使用を検討してくだ
さい。[Tortoise SVN でパッチを作成するためのチュートリアルを読む](https://ja.wordpress.org/team/handbook/core/tutorials/working-with-patches/#creating-a-patch-with-tortoisesvn)
ことができます。

### 󠀁[Mac/Linux コマンドライン](https://ja.wordpress.org/team/handbook/core/tutorials/trac/submitting-a-patch/?output_format=md#mac-linux-%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%83%a9%e3%82%a4%e3%83%b3)󠁿

[Mark Jaquith のチュートリアル](http://markjaquith.wordpress.com/2005/11/02/my-wordpress-toolbox/)
より

filename.php のパッチを作成する:

`$ svn diff filename.php > filename.diff`

チェックアウトで変更されたすべてのファイルのパッチを作成する:

`$ svn diff > big_patch.diff`

誰かからもらったパッチを適用する:

`$ patch -p0 < patch.diff`

Mac 用の GUI オプションもあります。パッチファイルを作成するのに必要なだけです (たとえば、
Versions ではできません)。

もしくは、Cristi Burca の [Git を使用して SVN パッチを作成する](http://scribu.net/wordpress/svn-patches-from-git.html)
もあります。

## 󠀁[GitHub のフォークを WP trunk のコピーに追加する](https://ja.wordpress.org/team/handbook/core/tutorials/trac/submitting-a-patch/?output_format=md#github-%e3%81%ae%e3%83%95%e3%82%a9%e3%83%bc%e3%82%af%e3%82%92-wp-trunk-%e3%81%ae%e3%82%b3%e3%83%94%e3%83%bc%e3%81%ab%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b)󠁿

まず最初に、どこかに自分の WordPress フォークが必要です。通常は GitHub にあります(
[ミラー](http://github.com/wordpress/wordpress-develop)があるためです)。フォーク
とブランチを作成したら (競合を避けるために master/trunk ブランチでは作業しないこと
が重要です)、この新しいリモートをあなたの git インスタンスに追加する必要があります。

`git remote add fork git@github.com:WordPress/wordpress-develop.git`

必要に応じて、リポジトリの URL または git の URL を使用してこのコマンドを変更します。

次に、ローカルの git インスタンスと連携させるコマンド `git fetch --all` を実行し
ます。

`git checkout fork/44722` のようなコマンドでフォークからマスターに切り替えたり、`
git checkout -b 44722` のように新しいブランチを作成できます。このコマンドは、正式
版ではなくフォーク版に切り替えることを要求しており、`git checkout fork master` で
実現可能です。

これで、いつものように git を使って、必要なコードの変更をすべて作成し、コミットでき
ます。[GitHub ミラー](https://github.com/wordpress/wordpress-develop)を開くと (WP
プロフィールを GitHub に関連付けると)、GH ページに新しいプルリクエストを作成する
ボタンが表示され、この変更が検出されます。

次のステップでは、[こちら](https://ja.wordpress.org/team/handbook/core/contribute/git/github-pull-requests-for-code-review/)
で説明したように、プルリクエストにチケット番号を含めた名前を付けます。GitHub との
統合に関するその他の情報は、このドキュメントページをご覧ください。

[原文](https://make.wordpress.org/core/handbook/tutorials/trac/submitting-a-patch/)/
[日本語訳](https://github.com/jawordpressorg/core-handbook/blob/main/core/tutorials/trac/submitting-a-patch.md)

公開日

2023年10月6日

最終更新

2023年10月8日

[  前へ: チケットを開く](https://ja.wordpress.org/team/handbook/core/tutorials/trac/opening-a-ticket/)

[  次へ: 開発チャットの調整](https://ja.wordpress.org/team/handbook/core/tutorials/coordinating-devchat/)