LoginSignup
59

More than 5 years have passed since last update.

git diff のとき変更したファイルだけを確認する

Posted at

通常の git diff では、追加したファイルやリネームしたファイルなども差分として表示されますが、それが邪魔に思うときもあります。

以下のようにすれば、変更したファイルについてだけ差分を表示することができます。

git diff --diff-filter=M

ちなみに、diff-filter は他にも、A (追加)、C (コピー)、D (削除)、R (リネーム)、などが指定できます。

僕は以下のようなエイリアスを作って使っています。

[alias]
        modified = diff --diff-filter=M

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
59