git remove files from repository code example
Example 1: delete file from a branch git
git rm --cached file1.txt
git commit -m "remove file1.txt"
Example 2: git delete file
// delete unused file.
// It will be placed on index area, and been deleted at next commit
git rm file-to-delete.ext
Example 3: git remove files from repo but not locally
git rm --cached `git ls-files -i -X .gitignore`
Example 4: delete file from a branch git
git rm file1.txt
git commit -m "remove file1.txt"