William Spanfelner 0ebc2eed5b Create git rm (#27054)
* Create git rm

Create git rm description, syntax and general use cases with link to authoritative documentation.

* Rename guide/english/git/git-rm/index.md to guide/english/git/git-rm.md

* Rename guide/english/git/git-rm.md to guide/english/git/git-rm/index.md
2018-12-21 08:11:48 -08:00

1.0 KiB

title
title
git rm

git rm

The git rm command removes, or deletes files from a working git tree and git index. See Git documentation for comprehensive details of the git -rm command. The git rm command will remove a file from everywhere within the git tree as there is no option for removing a file from only the working directory.

git rm --cached -r .

The wildcard "." in place of the filename position in the command git rm --cached -r . removes all files from the staging area in a recursive fashion, hence the "-r" option. The --cached option in essence protects working tree files regardless of whether modifications have been applied.

git rm -n

To determine which files would be affected by the git rm command, place the -n option in the command. Executing the command will indicate the files that would be removed had the -n option not been present.