2015-12-17 21:40:38 +00:00
|
|
|
# git rm
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Remove files from repository index and local filesystem.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <https://git-scm.com/docs/git-rm>.
|
2015-12-17 21:40:38 +00:00
|
|
|
|
2016-01-07 17:31:27 +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
|
|
|
|
2016-01-07 17:31:27 +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
|
|
|
|
2016-01-07 17:31:27 +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}}`
|