Search code examples
angularfilegitignore

gitIgnore for .history angular project


Why is gitignore not working for me? Why are files in .history folder not getting ignored?

enter image description here


Solution

  • Make sure to remove those files from the index first:

    git rm -r --cached src/.history/
    

    Then check the status reported by VSCode: those files should not be there.

    Note: the .gitignore rule should be

    .history/
    

    (no need for '*': you ignore the just the folder, with the trailing '/': that is enough)