I have tracked many many files early, but I don't want Git to track them any more from now on.
Can I untrack those files according to a .gitignore
file?
There are too many files and they are separated in many different directories, so it is not practical to remove them one-by-one, instead, I hope they can be untracked according to patterns in a .gitignore
file.
You need to remove the files from the index.
git rm -r --cached .
and then add
git add .
Finally commit:
git commit -a -m "Untrack ignored files!"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With