Viewing or copying the raw file content
With the raw view, you can view or copy the raw content of a file without any styling.
- GitHub.comで、リポジトリのメインページにアクセスしてください。
- Click the file that you want to view.
- In the upper-right corner of the file view, click Raw.
- Optionally, to copy the raw file content, in the upper-right corner of the file view, click .
Viewing the line-by-line revision history for a file
Blame ビューでは、 をクリックすることで、ファイル全体の行ごとのリビジョン履歴やファイル内の 1 つの行のリビジョン履歴を表示することができます。 をクリックするたびに、変更をコミットした者と時間を含む、その行の過去のリビジョン情報が表示されます。
ファイルやプルリクエストでは、 メニューを使って、選択した行や行の範囲の Git blame を表示することもできます。
ヒント: コマンドライン上で、ファイル内の行のリビジョン履歴を表示するために git blame
を使うこともできます。 詳細は Git の git blame
のドキュメンテーションを参照してください。
- GitHub.comで、リポジトリのメインページにアクセスしてください。
- クリックして、表示したい行の履歴のファイルを開きます。
- ファイルビューの右上隅で [Blame] をクリックして blame ビューを開きます。
- 特定の行の過去のリビジョンを表示するには、見てみたい変更が見つかるまで をクリックします。
Ignore commits in the blame view
All revisions specified in the .git-blame-ignore-revs
file, which must be in the root directory of your repository, are hidden from the blame view using Git's git blame --ignore-revs-file
configuration setting. For more information, see git blame --ignore-revs-file
in the Git documentation.
-
In the root directory of your repository, create a file named
.git-blame-ignore-revs
. -
Add the commit hashes you want to exclude from the blame view to that file. We recommend the file to be structured as follows, including comments:
# .git-blame-ignore-revs # Removed semi-colons from the entire codebase a8940f7fbddf7fad9d7d50014d4e8d46baf30592 # Converted all JavaScript to TypeScript 69d029cec8337c616552756310748c4a507bd75a
-
Commit and push the changes.
Now when you visit the blame view, the listed revisions will not be included in the blame. You'll see an Ignoring revisions in .git-blame-ignore-revs banner indicating that some commits may be hidden:
This can be useful when a few commits make extensive changes to your code. You can use the file when running git blame
locally as well:
git blame --ignore-revs-file .git-blame-ignore-revs