0

I have seen a number of SO articles on doing this, but the below is not working for me:

/src/client/*.bs.js

I would not mind if the pattern was

**/*.bs.js

But that also does not work.

I am using VSCODE with Git for Windows.

phd
  • 82,685
  • 13
  • 120
  • 165
Dr.YSG
  • 7,171
  • 22
  • 81
  • 139
  • Is the .gitignore file in the top level directory of your repository? – MZ97 Feb 19 '20 at 19:10
  • 2
    I'm not able to reproduce the behavior you describe. That is, the patterns both work in my tests. We may need additional information to understand why you're seeing something different. Are the files you want to ignore untracked? The most common misunderstanding about .gitignore is, people sometimes expect it to ignore changes to an otherwise-tracked file, which it will not do. So if not doing that is what makes you thin it isn't working... it's working. – Mark Adelsberger Feb 19 '20 at 19:25
  • What is your git version? – GoodDeeds Feb 19 '20 at 19:26
  • 3
    If the file is already on the repository, I believe you should firstly remove it from repo then ignore it. – Leonardo Alves Machado Feb 19 '20 at 19:37
  • 1
    Basically what @LeonardoAlvesMachado said, if the file is already committed to the repo, then you need to [**remove it from the cache**](https://stackoverflow.com/questions/7527982/applying-gitignore-to-committed-files) – Khalil Khalaf Feb 19 '20 at 19:38
  • 1
    Does this answer your question? [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – phd Feb 19 '20 at 19:45
  • This worked: git rm --cached **/*.bs.js (does any of you want to propose it as a solution so that I can mark it as the answer?) – Dr.YSG Feb 20 '20 at 14:58

0 Answers0