FahamLah

Commands

git rm

git rm [--cached] <file>

Risk: Careful

What it does

Deletes a file and tells Git.

When to use it

When a file should leave the project.

Example

$ git rm old.html

Delete it and stage the delete.

$ git rm --cached secret.txt

Stop tracking it, but keep the file.