Gerd
Gerd

Reputation: 2603

How can I reset a file ignore by git (not configured in .gitignore)?

Looking at ignored files show me:

git status --ignored

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .env

Ignored files:
  (use "git add -f <file>..." to include in what will be committed)

    dist/
    src/assets/icon/ui/wind1.svg

my .gitignore only contains

dist

Now I want reset the ignore of src/assets/icon/ui/* files. Where can I change this ignore-configuration?

There is only one .gitignore in my filesystem tree:

git ls-files '*.gitignore'
.gitignore

Upvotes: 0

Views: 76

Answers (2)

Gerd
Gerd

Reputation: 2603

git check-ignore -v src/assets/icon/ui/wind1.svg
/Users/gerd/.config/git/ignore:9:Icon   src/assets/icon/ui/wind1.svg

Change /Users/gerd/.config/git/ignore:9

Comment the Icon-exclude pattern.

Details:

Upvotes: 1

Travis
Travis

Reputation: 5061

You can have .gitignore files in every subdirectory.

Double check src, src/assets, src/assets/icon, and src/assets/icon/ui to make sure you don't have a .gitignore file in one of those subfolders also.

You can also run the command git ls-files '*.gitignore' inside of your project's directory to list all of the .gitignore files.

Upvotes: 0

Related Questions