HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

git rm — Remove files from repository index and local filesystem. More information: <https://git-scm.com/docs

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandfilesremovefromindexclirepositorygit rm

Problem

How to use the git rm command: Remove files from repository index and local filesystem. More information: <https://git-scm.com/docs/git-rm>.

Solution

git rm — Remove files from repository index and local filesystem. More information: <https://git-scm.com/docs/git-rm>.

Remove file from repository index and filesystem:
git rm {{path/to/file}}


Remove directory [r]ecursively:
git rm -r {{path/to/directory}}


Remove file from repository index but keep it untouched locally:
git rm --cached {{path/to/file}}

Code Snippets

Remove file from repository index and filesystem

git rm {{path/to/file}}

Remove directory [r]ecursively

git rm -r {{path/to/directory}}

Remove file from repository index but keep it untouched locally

git rm --cached {{path/to/file}}

Context

tldr-pages: common/git rm

Revisions (0)

No revisions yet.