Gitignore

How to stop tracking a directory/file that was previously an exception in .gitignore

  • If '.gitignore' is configured to ignore everything except a list of exceptions, and I want to start ignoring a file/folder (i.e., remove the exception) I do:

    • Modify the '.gitignore' file and submit only it to GitHub.

    • Remove the file/folder locally.

    • Commit the local changes and do a Fetch Origin and Push from GitHub Desktop to GitHub.

    • Done. After that, I can put the file/folder back in the local repo without problems, since it's no longer listed as an exception in '.gitignore'.