Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial archive specific folder/files?

In SVN, I can do this to only export contents in folder2

svn export svn://source/Trunk/folder1/folder2 -r HEAD

How can I do the same in Mercurial? It seems that hg archive only accepts the target path not the source path. If I do hg archive target_path/folder it will export everything in the repository.

Thanks in advance.

like image 415
StarCub Avatar asked Mar 02 '26 20:03

StarCub


1 Answers

Use the --include and --exclude directives

hg archive -I 'target_path/folder/*' my_stuff.tar

will get everything from folder on down.

like image 142
msw Avatar answered Mar 06 '26 04:03

msw