I need to exclude a folder (name uploads) from tracking. I tried to run
git rm -r --cached wordpress/wp-content/uploads
and after that I added the path to .gitignore
/wordpress/wp-content/uploads
but when I ran git status
they show up as deleted. If I try to commit the changes, the files will be deleted, not only removed from tracking.
What am I doing wrong?
I have also tried
git update-index --assume-unchanged <file>
but this seems to untrack only files. But I need to remove an entire folder (including subfolders) from tracking.
reset --hard
, it will. – Caesareanpull
that commit somewhere else those files will be deleted from the new system. – Insubstantialgit ls-files
– Lovellalovelock