简体   繁体   中英

gitignore does not ignore a file

I have config.ts on ./packages/dashboard/src/core/config.ts path and I would like to ignore in git.

I put those into gitignore file and nothing happens, the file is not ignored.

config.ts
./packages/dashboard/src/core/config.ts
packages/dashboard/src/core/config.ts

What is wrong? How to ignore this file to prevent changes in ?

First, make sure it is not already tracked:

git rm --cached ./packages/dashboard/src/core/config.ts

Second, check the .gitignore does apply with:

git check-ignore -v -- ./packages/dashboard/src/core/config.ts

If the output of that command is not empty, that means the file is indeed ignored.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM