You can follow the following steps and commands to remove a folder from my git repository without deleting it from my local machine.
Step 1. Firstly, you'd need to add the folder path to your repo's root .gitignore file.
path_to_your_folder/
Step 2. Remove the folder from your local git tracking, but keep it on your local system disk using this:
git rm -r --cached path_to_your_folder/
Step 3. Push your changes to your git repo.
The folder will be considered "deleted" from Git's point of view (i.e. they are in the past history, but not in the latest commit, and people pulling from this repo will get the files removed from their trees), but stay on your working directory because you've used --cached
I hope this helps!