43
48

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Git] 変更のあったファイル名を列挙する(内容の差分は表示しない)

Last updated at Posted at 2016-09-11

メモ程度。「あのブランチ/コミットからどのファイルを変更/追加/削除したんだっけな~」と確認する時につかう用。
git diff--name-only オプションを使います。

$ git diff --name-only <branch_name,commit_id>

ちょっといい例がなかったけれども、例えば README.md が変更されてた場合は以下のように表示されます。

ファイル名を列挙
$ git diff --name-only origin/master
README.md

git diff なんで基本的にルートからのパスで表示されます。

$ git diff --name-only origin/master
path/to/README.md

変更か追加か削除か知りたい場合は --name-status を使ってください。

もうちょっと詳しく
$ git diff --name-status  origin/master
A    README.md      //追加
M    main.c         //変更
43
48
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
43
48

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?