In some case, in the middle of our developlment, you have to add a new file or directory to the .gitignore
file.
How do you do that?
Well, first of all make sure that the changed files in your project are saved in a commit. Then, add your file or directory to your .gitignore
file.
Run these commands below to clear your repository cache and save again in a new commit:
git rm -r --cached .