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

hg add — Adds specified files to the staging area for the next commit in Mercurial. More information: <https:

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandfileshg addcliaddsspecifiedstaging

Problem

How to use the hg add command: Adds specified files to the staging area for the next commit in Mercurial. More information: <https://www.mercurial-scm.org/help/commands/add>.

Solution

hg add — Adds specified files to the staging area for the next commit in Mercurial. More information: <https://www.mercurial-scm.org/help/commands/add>.

Add files or directories to the staging area:
hg add {{path/to/file}}


Add all unstaged files matching a specified pattern:
hg add {{[-I|--include]}} {{pattern}}


Add all unstaged files, excluding those that match a specified pattern:
hg add {{[-X|--exclude]}} {{pattern}}


Recursively add sub-repositories:
hg add {{[-S|--subrepos]}}


Perform a test-run without performing any actions:
hg add {{[-n|--dry-run]}}

Code Snippets

Add files or directories to the staging area

hg add {{path/to/file}}

Add all unstaged files matching a specified pattern

hg add {{[-I|--include]}} {{pattern}}

Add all unstaged files, excluding those that match a specified pattern

hg add {{[-X|--exclude]}} {{pattern}}

Recursively add sub-repositories

hg add {{[-S|--subrepos]}}

Perform a test-run without performing any actions

hg add {{[-n|--dry-run]}}

Context

tldr-pages: common/hg add

Revisions (0)

No revisions yet.