tldr/pages/common/git-rm.md

17 lines
364 B
Markdown
Raw Normal View History

2015-12-17 21:40:38 +00:00
# git rm
> Remove files from repository index and local filesystem.
> More information: <https://git-scm.com/docs/git-rm>.
2015-12-17 21:40:38 +00:00
- Remove file from repository index and filesystem:
2015-12-17 21:40:38 +00:00
2022-12-04 09:12:49 +00:00
`git rm {{path/to/file}}`
2015-12-17 21:40:38 +00:00
- Remove directory:
2015-12-17 21:40:38 +00:00
2022-12-04 09:12:49 +00:00
`git rm -r {{path/to/directory}}`
2015-12-17 21:40:38 +00:00
- Remove file from repository index but keep it untouched locally:
2015-12-17 21:40:38 +00:00
2022-12-04 09:12:49 +00:00
`git rm --cached {{path/to/file}}`