I have a directory named packages immediately under my git repository (root/packages/files here) and another with the same name in some other subfolder(root/directory1/packages/files here). I want to make sure that everything in the former is removed and the latter stays as is. Is this command going to match both? If yes, what can I do to make sure only root/packages/all files is targeted by git rm?
git filter-branch --index-filter 'git rm --cached --ignore-unmatch packages/*' --prune-empty HEAD