2018-01-09 19:51:46 +00:00
|
|
|
# hg remove
|
|
|
|
|
|
|
|
> Remove specified files from the staging area.
|
2025-08-11 18:50:53 -07:00
|
|
|
> More information: <https://www.mercurial-scm.org/help/commands/remove>.
|
2018-01-09 19:51:46 +00:00
|
|
|
|
|
|
|
- Remove files or directories from the staging area:
|
|
|
|
|
|
|
|
`hg remove {{path/to/file}}`
|
|
|
|
|
|
|
|
- Remove all staged files matching a specified pattern:
|
|
|
|
|
2025-04-25 14:45:48 +03:00
|
|
|
`hg remove {{[-I|--include]}} {{pattern}}`
|
2018-01-09 19:51:46 +00:00
|
|
|
|
|
|
|
- Remove all staged files, excluding those that match a specified pattern:
|
|
|
|
|
2025-04-25 14:45:48 +03:00
|
|
|
`hg remove {{[-X|--exclude]}} {{pattern}}`
|
2018-01-09 19:51:46 +00:00
|
|
|
|
|
|
|
- Recursively remove sub-repositories:
|
|
|
|
|
2025-04-25 14:45:48 +03:00
|
|
|
`hg remove {{[-S|--subrepos]}}`
|
2018-01-09 19:51:46 +00:00
|
|
|
|
|
|
|
- Remove files from the repository that have been physically removed:
|
|
|
|
|
2025-04-25 14:45:48 +03:00
|
|
|
`hg remove {{[-A|--after]}}`
|