I have the following file structure and seem to be doing something wrong with handling the gitignore. I am trying to make sure variable.js is not pushed but despite it being listed under gitignore, it is still showing up on github. Could someone please tell me what I am doing wrong here?
Asked
Active
Viewed 290 times
0
1 Answers
0
You need to provide file/folder name you want to ignore. In your case variable.js
- it will ignore every file in your project that is variable.js
.
If you only want to ignore file in root folder, add /variable.js
to gitignore
edit: try to delete (move) file then commit changes. this should do the trick

PYTHON DEVELOPER999
- 301
- 2
- 12
-
That didn't seem to help. Also I tried git rm --cached varibale.js and it told me it didnt match any of the file names – TNT928 Jun 13 '21 at 13:30
-
show content of your `.gitignore` – PYTHON DEVELOPER999 Jun 13 '21 at 14:01
-
That's what the picture i posted is. – TNT928 Jun 13 '21 at 14:04
-
@TNT928 Did you find a solution to it? I have a folder that I have put in gitignore but files inside it always show up anyway. – mfs Dec 25 '21 at 13:03