Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore is not working on Windows

Tags:

git

windows

I used to develop on linux environment, but now I need to write a git project on "windows" os. I need to ignore a directory from where the git is initiated.

like folder/.git/, now I need to ignore /folder/project/bin/*. So I have added .gitignore file on folder/.gitignore using both text pad and Visual studio.

.gitignore file contents are

/project/bin/*

Now, I expect git status should not show /project/bin folder.

Note, I have tried other ways too, but it seems that git is considering the .gitignore file as a general text file or so.

like image 225
Sumsuddin Shojib Avatar asked Sep 20 '25 15:09

Sumsuddin Shojib


1 Answers

Just a guess, but I suspect that the leading forward-slash is throwing something off. I'm not sure about the trailing star either (as I reference my own .gitignore files).

Your .gitignore should be this:

project/bin/
like image 76
selbie Avatar answered Sep 22 '25 06:09

selbie