GIT-RM(1) Git GIT-RM(1) (NAME) git-rm - (SYNOPSIS) git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--pathspec-from-file= [--pathspec-file-nul]] [--] [...] (DESCRIPTION) (pathspec) . git rm . ( /bin/rm .) -f . --cached . sparse-checkout ( git-sparse-checkout(1) ) git rm sparse-checkout . (OPTIONS) ... . ( dir dir/file1 dir/file2) -r . . (globbing) . d d2 git rm 'd*' git rm 'd/*' d2 . gitglossary(7) . -f, --force . -n, --dry-run . -r . -- ( ). --cached (unstage) . . --ignore-unmatch () . --sparse sparse-checkout . git rm sparse-checkout . git-sparse- checkout(1) . -q, --quiet git rm ( rm) . . --pathspec-from-file= (pathspec) . - . pathspec LF CR/LF . pathspec core.quotePath ( git-config(1) ). --pathspec-file-nul --literal-pathspecs . --pathspec-file-nul --pathspec-from-file . pathspec NUL ( ). (REMOVING FILES THAT HAVE DISAPPEARED FROM THE FILESYSTEM) git rm . . "git commit -a" rm ( git rm) git commit -a . git add -u . "git add -A" (code drop) (vendor branch) . : git ls-files -z | xargs -0 rm -f (untar) . rsync . : git add -A git-add(1) . (Other ways) ( git commit -a ) : git diff --name-only --diff-filter=D -z | xargs -0 git rm --cached (SUBMODULES) gitfile ( 1.7.8 ) .git . ( ) .git git rm git git . submodule. gitmodules(5) (staged) ( --cached -n ). HEAD . . (local checkout) git-submodule(1) deinit . gitsubmodules(7) . (EXAMPLES) git rm Documentation/\*.txt *.txt Documentation . * () Documentation/ . git rm -f git-*.sh ( ) subdir/git-foo.sh . (BUGS) ( ) . gitfile . . (SEE ALSO) git-add(1) (GIT) git(1) Git 2.55.0 2026-06-29 GIT-RM(1)