.gitignore looks not working

In my .gitignore file in GitHub I wrote:


But via composer still both .git folder and .gitignore file are downloaded with the package. What should I do?

the back of my head’s saying if you put gitignore in the ignore list, how will it know what to ignore…

Do you mean to remove .gitignore from the file content?

Did you commit the .git ignore at some point before you excluded it?

Please advise how to do so?

My point was, you shouldn’t have if you did. If you did do that, delete the .gitignore, push the changes, and then recreate it ignoring itself.

I just have it in root of my GitHub, I don’t know what to do more? Please advise how to enforce it working? All I did is adding the file in root of my project.

You added it directly to Github? If so, there is your problem. You need to add it to your local project and then push the project to GitHub. Add this to your local .gitignore


1 Like