Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

.gitignore not working right after git init

I have reading plenty of answers, but none of them works for me. Specifically:

I have a project where I want to ignore all .csv files. So, when I run git init the git hidden folder is created, I go in there, create the text file .gitignore and I write inside :

*.csv

However, when I run git status it doesn’t work. I thought it was because when you create a file in windows, you need to choose an extension. So in my case the name of the file actually was .gitignore.txt, but thanks to this answer I was able to name it correctly. However, when I run git status still appear all .csv files. And no, I haven’t added those files (because as I said at the begining, I just run git init and given my research, git init doesn’t run a git add behind). Here is a photo of the .git folder:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

And the git status output (some lines of it):

enter image description here
Any suggestions?

>Solution :

.gitignore does not go into .git/, it goes in the top level directory with your normal files.

If you don’t want to check in your ignore file (generally you should), you can instead use .git/info/exclude

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading