skip to Main Content

I have two files .cat and .inf which are not mentioned in the .gitignore file. But still, they are greyed out in VS code which shows that they are not getting committed/uploaded to the git repo.

my-file.cat
my-file.inf

I am using the visual studio default .gitignore file.

ref: https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

how to explicitly mention to include some files. or are there any global ignore settings in which these files are mentioned to be ignored by default?

2

Answers


  1. You can explicitly tell .gitignore file to include some files by prefixing a bang like

    !my-file.cat
    !my-file.inf
    

    You should prefer to actually figure out what’s making them be ignored though. (Maybe they’re in an ignored folder?)

    Login or Signup to reply.
  2. Use check-ignore to see which rule is ignoring the files:

    git check-ignore -v my-file.cat
    

    It will tell you which rule in which file is causing the file to be ignored. Then adjust that file accordingly.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search