diff --git a/guide/english/git/git-rm/index.md b/guide/english/git/git-rm/index.md new file mode 100644 index 0000000000..7474c567d8 --- /dev/null +++ b/guide/english/git/git-rm/index.md @@ -0,0 +1,13 @@ +--- +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. +