The Be Sure Blog

Code Snippets | Problem Solving | Tips & Tricks

The Be Sure Blog banner

Fixing .gitignore is ignoring a .gitignore rule

posted on 26.2.2023 by Below Surface in "GitHub"

When all your attempts failed, you may try this:

$ git rm -r --cached .

This will remove the whole Git cache from your local machine. After that, check if the .gitignore rule is set properly. The folder should now be greyed out (ignored). Then run:

$ git add.
$ git commit -m "cleared local git cache"
$ git push

Tags:

github
.gitignore
fix

More posts of this category

Get started with GitHub Actions

Learn about CI/CD with GitHub

GitHub

Git Merge VS Rebase, pros and cons for each

Learn more about git merge and git rebase and their differences

GitHub

CI/CD: How I finally fixed "err: npm WARN EBADENGINE"

Running the same .sh script may deliver two different results, not anymore!

GitHub

Delete files and folders from GitHub history

How I deleted a folder from the GitHub history of a repository

GitHub