Gitignore Not Working Fix

gitignore not working fix

Gitignore Not Working Fix

 |   |  0

Hi, gitignore not working? if you added .gitignore file later, then you will surely have the problem that not working and every files that are ignored still changing. For this, I am helping you.

First make sure you have committed all the changes that you have made locally, and also you have fetched the code from the master to your local repo that others have committed, means you must pull and push before thinking about it.

Then, Clear the local cache of git. The first step towards getting gitignore to work is to clear your local Git cache. To do that, execute the following command inside your project’s folder.

git rm -r --cached .

This will help you clear all the local cache (recursively), that is usually the culprit for not making our .gitignore file to work. Now, the next time you commit a change, .gitignore will be forced to create a cache and then push it off to your repo. Then commit and stay happy. Once you are done clearing the cache, its time to be happy, and watch .gitignore do the work it is supposed to do. Just add your changes and commit them.

git add .

git commit -m "Refreshing .gitignore"

That should be it. Git is one of the most powerful tool we’ve ever seen in our life. It just makes our lives easier. The more complex your setup is, the more easy it is to manage with these code versioning tools and don’t give up on your bugs!

0 Claps

Show your love in the form of Claps and Comments...


No comments found. Leave your reply here.