Search
Close this search box.

.gitignore is not working how to fix it ?

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
The cycle of uploading to remote is in general
add >>> commit >>>sign >> push

In this process, files like the one generated by the IDE should be ignored.
That’s why we use “.ignore” files.
By reffereing to git:If you create a file in your repository named .gitignore, Git uses it to determine which files and directories to ignore, before you make a commit. A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository.

The problem is that sometime you add file to .gitignore file (path by line) but we still see these files in tracking files. To fix this issue open the git terminal in your project directory then use these:

git rm -r --cached .
git add -A
git commit -am 'Removing ignored files'

and then you can push normally.

Share this post