0
0

More than 1 year has passed since last update.

【Git】どこでignoreされているか確認する方法

Posted at

確認方法

ignoreされているファイルがどこでignoreされているのか確認するには次のコマンドを実行します。

git check-ignore -v ファイルパス
$ tree
.
├── .git
│   ├── info
│   │   └── exclude
│ 
├── .gitignore
├── example.txt
├── sample.txt
└── test.txt

$ cat .gitignore
/sample.txt

$ cat .git/info/exclude
/example.txt

$ cat ~/.config/git/ignore
/test.txt

$ git check-ignore -v *
.git/info/exclude:1:/example.txt        example.txt
.gitignore:1:/sample.txt        sample.txt
/Users/Username/.config/git/ignore:1:/test.txt     test.txt

以上のようにignoreの設定がされているファイルと行数が表示されます。

0
0
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
0
0