gitignore
git
git cache
Git continues to track the files that are listed in gitignore
gitignore not working correctly
If you use GitHub Desktop, you might have recently encountered a problem where it continues to track files and folders that are already inside the .gitignore
file.
Screenshot
This problem occurs when we exclude a folder from .gitignore
and then add it back later.
While it seems like GitHub Desktop should update immediately, it might continue tracking those files due to its cache.
We need to untrack the files before the .gitignore
rules will apply. We can untrack files with the following command:
terminal or console
git rm -r --cached .svelte-kit
This command specifically removes the cache for the
.svelte-kit
directory within the GitHub Desktop cache
Then commit the changes:
terminal or console
git commit -m "Untrack .svelte-kit directory"
Now, open the GitHub Desktop and push the changes