Photo by Jon Tyson on Unsplash
The other day I had created a new React Native module project and pushed it to the git repository. Then later, I added the file .gitignore.
Since we added it later, these files will still exist in our repository index. How can we clean them up?
Commit all your local changes including .gitignore
git commit -am "file changes"
Remove everything from the repository
git rm -r --cached .
#
--cached will only remove files from the index.
.
Indicates all files will be untracked
or
you can un-track individual files
git rm --cached ios/Pods
Re-add everything
git add --all
Commit the files
git commit -m "cleanup .gitignore files"
Top comments (0)