Answer the question
In order to leave comments, you need to log in
How to specify a specific file in .gitignore?
I have three files on the disk in their directories:
./modules/module1/package.json
./package.json
./.gitignore
/package.json
On branch master
Initial commit
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
modules/
On branch master
Initial commit
Untracked files:
(use "git add <file>..." to include in what will be committed)
../.gitignore
./
Answer the question
In order to leave comments, you need to log in
Actually, you specified everything correctly, you just check
https://git-scm.com/docs/gitignore incorrectly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question