Search code examples
gitgitignore

Git ignore ignoring too many things


I have folder and src/folder. I want to ignore the former but not the latter, except folder in .gitignore ignores both.


Solution

  • folder matches any file and directory named "folder" in any directory. Put a slash in front:

    /folder
    

    This only matches the directory in the root of your repository.