Search code examples
gitgitignore

gitignore not ignoring files properly


I want to ignore some files in git but git is staging the files mentioned in gitignore.

My gitignore.

*.exe
*.out
*.app

Local Repository Strucutre

algorithms/          //contains cpp files with .exe
data structure/      //contains cpp files with .exe
git.gitignore        <-- gitignore
README.md
LICENSE

Staging files

enter image description here


Solution

  • As I can see in the background of the first image, you have named your file git.gitignore, The name must be .gitignore