- 1 year ago
Pass file list to Mercurial 'hg add' command from text file
Comment
1 / 1
You can pass a list of files to the Mercurial hg add
command from a text file using the --files
option. Here's how you can do it:
- Create a text file containing a list of files you want to add. For example, you could create a file called
filelist.txt
with the following contents:
file1.txt
file2.txt
file3.txt
Open a command prompt or terminal window and navigate to the directory containing the files you want to add.
Run the following command to add the files listed in
filelist.txt
:
sqlhg add --files filelist.txt
This will add the files listed in filelist.txt
to the Mercurial repository.
Note that the --files
option can also be used to specify a pattern to match against file names, such as --files **/*.txt
to add all .txt
files in subdirectories.