Want to delete a file from a Git repository?
The following command will delete a file from a repository and the filesystem.
git rm example.txt
git commit -m "Deleted example.txt from the repository"
The following command will delete a file from a repository but keep it in the filesystem.
git rm --cached example.txt
git commit -m "Deleted example.txt from the repository"