Command

git rm

Stages removal of tracked paths and normally deletes working files. -n previews; --cached leaves the working copy. Git checks for incompatible changes. Inspect before deleting.

Formal Syntax & Structure

git syntaxgit
git rm [-n] [--cached] -- path

Working Example

Example Snippetgit
git rm -n -- obsolete.txt
Git Reference