Check out example codes for "gremove folder from git". It will help you in understanding the concepts better.

Code Example 1

This code will remove a git folder

Code Example 2

git rm -r --cached <folder>
git commit -m "Removed Folder"
git push origin master

Code Example 3

git rm -r --cached FolderName
git commit -m "Removed folder from repository"
git push origin master

Learn ReactJs, React Native from akashmittal.com