LinuxCommandLibrary

hg-add

schedules files to be added to the repository on the next commit

TLDR

Add a specific file

$ hg add [file]
copy
Add all new files
$ hg add
copy
Add files by pattern
$ hg add '*.py'
copy
Add files in directory
$ hg add [path/to/directory]
copy
Dry run to preview
$ hg add -n [file]
copy

SYNOPSIS

hg add [options] [files...]

DESCRIPTION

hg add schedules files to be added to the repository on the next commit. Without arguments, it adds all new files in the working directory. Use a .hgignore file to exclude files from version control. Added files appear with 'A' status in hg status until committed.

PARAMETERS

-n, --dry-run

Do not perform actions, preview only.
-I, --include pattern
Include files matching pattern.
-X, --exclude pattern
Exclude files matching pattern.

SEE ALSO

hg(1), hg-commit(1), hg-status(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community