Remove a directory from your Git repository.
Use rm -r switch with the git command to remove directory recursively. After removing the directory you need to commit changes to the local git repository. Then push the changes to remove the directory from the remote git repository.
git rm -r public Then commit and push to apply changes in the local and remote repository.
git commit -m “Removed public directory” git push origin master # Master = your branch name
All done, The public folder has been removed from local as well as remote git repository.