When using git we sometimes need to ignore some files or folders. We generally create the .gitignore file in the root directory of the repository
Before committing, modify the .gitignore file to add files that need to be ignored. Then do add commit push etc.
But sometimes in the used name, the .gitignore file needs to be modified again. This time we need to clear the cache for .gitignore to take effect.
specific methods:
- git rm -r --cached . #Clear cache
- git add . #retrace file
- git commit -m "update .gitignore" #Commit and comment
- git push origin master #Optional, if you need to synchronize to the remote
This will enable the modified .gitignore to take effect.