8
3

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 1 year has passed since last update.

git diff から特定のフォルダを除外する

Last updated at Posted at 2021-12-17

:(exclude)【除外したいpathのパターン】

gitのコマンド(diffに限らず)でpathを指定する場合pathspecが使えます。
例えばこうなります。

git diff master -- ':(exclude)*/test/*'

これで*/test/*に一致するパスは無視されます。
pathspecについてのGitの記事はこちら

こちらの記事が内容を詳しく調査してくださっています。

gitのバージョンにも左右されますが、シンプルでわかりやすく大変便利です。

8
3
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
8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?