It seems like I have an issue where a folder "Resources/" was added to .gitignore
on our development branch, while another developer mistakenly committed files to this folder in a feature branch (off of development). When the feature branch was merged into the development branch, it added the files, then stopped tracking the folder and now thinks that "/Resources" and the files within it do not exist, as they should not.
The issue we're having now though, as I see from cloning the branch and switching into development, is that the files in Resources/ download, since they're added in git, but not removed.
My initial thought was to remove "/Resources" from .gitingore
and then delete the files. However, if I try to remove the "/Resources" folder from .gitignore
, git thinks they're new and tries to add the folder and the files that were added.
Edit: I tried to use git filter-branch
, as this other post mentions but I get an error saying "fatal: bad revision 'rm'"
git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch Resources/' --prune-empty --tag-name-filter cat -- --all
Is there a way to remove the files from a directory which are being ignored?