# コミットを検索する

GitHub 上のコミットを検索することができ、これらのコミット検索修飾子を組み合わせることで、結果を絞ることができます。

GitHub 全体にわたってグローバルにコミットを検索できます。あるいは、特定のリポジトリや organization 内のコミットも検索もできます。 詳しくは、「[GitHubでの検索について](/ja/search-github/getting-started-with-searching-on-github/about-searching-on-github)」をご覧ください。

コミットを検索すると、リポジトリの[既定のブランチ](/ja/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches)のみが検索されます。

> \[!TIP]
>
> * この記事には、GitHub.com の Web サイトでの検索例へのリンクが含まれていますが、同じ検索フィルターはあらゆる GitHub プラットフォームで使えます。 リンクされている検索例で、`github.com` を GitHub プラットフォームのホスト名に置き換えてください。
> * 検索結果をさらに改善するために検索修飾子を追加できる検索構文の一覧については、「[検索構文を理解する](/ja/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax)」を参照してください。
> * 複数単語の検索用語は引用符で囲みます。 たとえば "In progress" というラベルの問題を検索したい場合は、`label:"in progress"` と検索します。 検索では、大文字と小文字は区別されません。

## コミットメッセージ内を検索

メッセージに特定の単語を含むコミットを検索できます。 たとえば、[**fix typo**](https://github.com/search?q=fix+typo\&type=Commits) は、「fix」と「typo」という単語を含むコミットにマッチします。

## 著者またはコミッターで検索

`author` や `committer` の修飾子を使用すると、特定のユーザーによるコミットを発見できます。

| 修飾子                                                                                                                    | 例 |
| ---------------------------------------------------------------------------------------------------------------------- | - |
| <code>author:<em>USERNAME</em></code>                                                                                  |   |
| \[                                                                                                                     |   |
| **author:defunkt**]\(<https://github.com/search?q=author%3Adefunkt&type=Commits>) は、@defunkt が作成したコミットとマッチします。         |   |
| <code>committer:<em>USERNAME</em></code>                                                                               |   |
| \[                                                                                                                     |   |
| **committer:defunkt**]\(<https://github.com/search?q=committer%3Adefunkt&type=Commits>) は、@defunkt がコミットしたコミットとマッチします。 |   |

`author-name` と `committer-name` の修飾子は、作成者またはコミッターの名前によるコミットとマッチします。

| 修飾子                                                                                                                                       | 例 |
| ----------------------------------------------------------------------------------------------------------------------------------------- | - |
| <code>author-name:<em>NAME</em></code>                                                                                                    |   |
| \[                                                                                                                                        |   |
| **author-name:wanstrath**]\(<https://github.com/search?q=author-name%3Awanstrath&type=Commits>) は、作成者名に「wanstrath」を含むコミットとマッチします。         |   |
| <code>committer-name:<em>NAME</em></code>                                                                                                 |   |
| \[                                                                                                                                        |   |
| **committer-name:wanstrath**]\(<https://github.com/search?q=committer-name%3Awanstrath&type=Commits>) は、コミッター名に「wanstrath」を含むコミットとマッチします。 |   |

`author-email` と `committer-email` の修飾子は、作成者またはコミッターの完全なメール アドレスによるコミットとマッチします。

| 修飾子                                                                                                                          | 例 |
| ---------------------------------------------------------------------------------------------------------------------------- | - |
| <code>author-email:<em>EMAIL</em></code>                                                                                     |   |
| \[                                                                                                                           |   |
| \*\*                                                                                                                         |   |
| author-email:<chris@github.com>                                                                                              |   |
| \*\*                                                                                                                         |   |
| ]\(<https://github.com/search?q=author-email%3Achris%40github.com&type=Commits>) は <chris@github.com> が作成したコミットとマッチします。      |   |
| <code>committer-email:<em>EMAIL</em></code>                                                                                  |   |
| \[                                                                                                                           |   |
| \*\*                                                                                                                         |   |
| committer-email:<chris@github.com>                                                                                           |   |
| \*\*                                                                                                                         |   |
| ]\(<https://github.com/search?q=committer-email%3Achris%40github.com&type=Commits>) は <chris@github.com> がコミットしたコミットとマッチします。 |   |

## 作成日またはコミット日で検索

`author-date` と `committer-date` の修飾子を使用すると、指定した日付範囲内で作成またはコミットされたコミットとマッチできます。

日付に対して検索を行う場合、結果をさらにフィルタリングするためにより大きい、より小さい、範囲の修飾子を利用できます。 詳しくは、「[検索構文を理解する](/ja/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax)」をご覧ください。

| 修飾子                                                                                                                                                                                                                     | 例 |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| <code>author-date:<em>YYYY-MM-DD</em></code>                                                                                                                                                                            |   |
| \[                                                                                                                                                                                                                      |   |
| **author-date:<2016-01-01**]\(<https://github.com/search?q=author-date%3A><2016-01-01\&type=Commits) は、2016-01-01 より前に作成されたコミットとマッチします。                                                                                 |   |
| <code>committer-date:<em>YYYY-MM-DD</em></code>                                                                                                                                                                         |   |
| \[                                                                                                                                                                                                                      |   |
| **committer-date:>2016-01-01**]\([https://github.com/search?q=committer-date%3A>2016-01-01\&type=Commits](https://github.com/search?q=committer-date%3A>2016-01-01\&type=Commits)) は、2016-01-01 より後にコミットされたコミットとマッチします。 |   |

## マージコミットをフィルタリングする

`merge` 修飾子はマージ コミットをフィルタリングします。

| 修飾子                                                                                             | 例 |
| ----------------------------------------------------------------------------------------------- | - |
| `merge:true`                                                                                    |   |
| \[                                                                                              |   |
| **merge:true**]\(<https://github.com/search?q=merge%3Atrue&type=Commits>) はマージ コミットとマッチします。     |   |
| `merge:false`                                                                                   |   |
| \[                                                                                              |   |
| **merge:false**]\(<https://github.com/search?q=merge%3Afalse&type=Commits>) はマージ以外のコミットとマッチします。 |   |

## ハッシュで検索

`hash` 修飾子は、指定された SHA-1 ハッシュを含むコミットとマッチします。

| 修飾子                                                                                                                                                                                                                                | 例 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| <code>hash:<em>HASH</em></code>                                                                                                                                                                                                    |   |
| \[                                                                                                                                                                                                                                 |   |
| **hash:124a9a0ee1d8f1e15e833aff432fbb3b02632105**]\(<https://github.com/github/gitignore/search?q=hash%3A124a9a0ee1d8f1e15e833aff432fbb3b02632105&type=Commits>) は、ハッシュ `124a9a0ee1d8f1e15e833aff432fbb3b02632105` を含むコミットとマッチします。 |   |

## 親で検索

`parent` 修飾子は、親が指定された SHA-1 ハッシュを持つコミットとマッチします。

| 修飾子                                                                                                                                                                                                                                                     | 例 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| <code>parent:<em>HASH</em></code>                                                                                                                                                                                                                       |   |
| \[                                                                                                                                                                                                                                                      |   |
| **parent:124a9a0ee1d8f1e15e833aff432fbb3b02632105**]\(<https://github.com/github/gitignore/search?q=parent%3A124a9a0ee1d8f1e15e833aff432fbb3b02632105&type=Commits&utf8=%E2%9C%93>) は、ハッシュ `124a9a0ee1d8f1e15e833aff432fbb3b02632105` を持つコミットの子孫と一致します。 |   |

## ツリーで検索

`tree` 修飾子は、指定された SHA-1 Git ツリー ハッシュを含むコミットとマッチします。

| 修飾子                                                                                                                                   | 例 |
| ------------------------------------------------------------------------------------------------------------------------------------- | - |
| <code>tree:<em>HASH</em></code>                                                                                                       |   |
| \[                                                                                                                                    |   |
| **tree:99ca967**]\(<https://github.com/github/gitignore/search?q=tree%3A99ca967&type=Commits>) は、ツリー ハッシュ `99ca967` を参照するコミットとマッチします。 |   |

## ユーザまたは Organization のリポジトリ内の検索

特定のユーザーまたは組織が所有するすべてのリポジトリでコミットを検索するには、`user` または `org` 修飾子を使用します。 特定のリポジトリ内のコミットを検索するには、`repo` 修飾子を使用します。

| 修飾子                                                                                                                                                                                                     | 例 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| <code>user:<em>USERNAME</em></code>                                                                                                                                                                     |   |
| \[                                                                                                                                                                                                      |   |
| **gibberish user:defunkt**]\(<https://github.com/search?q=gibberish+user%3Adefunkt&type=Commits&utf8=%E2%9C%93>) は、@defunkt が所有するリポジトリ内で「gibberish」という単語を含むコミット メッセージとマッチします。                           |   |
| <code>org:<em>ORGNAME</em></code>                                                                                                                                                                       |   |
| \[                                                                                                                                                                                                      |   |
| **test org:github**]\(<https://github.com/search?utf8=%E2%9C%93&q=test+org%3Agithub&type=Commits>) は、@github が所有するリポジトリ内で「test」という単語を含むコミット メッセージとマッチします。                                               |   |
| <code>repo:<em>USERNAME/REPO</em></code>                                                                                                                                                                |   |
| \[                                                                                                                                                                                                      |   |
| **language repo:defunkt/gibberish**]\(<https://github.com/search?utf8=%E2%9C%93&q=language+repo%3Adefunkt%2Fgibberish&type=Commits>) は、@defunkt の「gibberish」リポジトリ内で「language」という単語を含むコミット メッセージとマッチします。 |   |

## リポジトリの可視性によるフィルタ

`is` 修飾子は、指定した可視性を持つリポジトリからのコミットとマッチします。 詳しくは、「[リポジトリについて](/ja/repositories/creating-and-managing-repositories/about-repositories#about-repository-visibility)」をご覧ください。

| 修飾子                                                                                                  | 例 |
| ---------------------------------------------------------------------------------------------------- | - |
| `is:public`                                                                                          |   |
| \[                                                                                                   |   |
| **is:public**]\(<https://github.com/search?q=is%3Apublic&type=Commits>) はパブリック リポジトリへのコミットと一致します。    |   |
|                                                                                                      |   |
| `is:private`                                                                                         |   |
| \[                                                                                                   |   |
| **is:private**]\(<https://github.com/search?q=is%3Aprivate&type=Commits>) はプライベート リポジトリへのコミットと一致します。 |   |

## 参考資料

* [検索結果をソートする](/ja/search-github/getting-started-with-searching-on-github/sorting-search-results)