how to remove directory from git history code example
Example 1: git remove directory from tracking
Remove the folder from your local git tracking, but keep it on your disk.
git rm -r --cached path_to_your_folder/
Example 2: how to remove git from a folder
rm -rf .git