how to share a file between 2 repositories? Hardlinks?
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Tue Oct 7 08:26:41 UTC 2025
Using a hardlink will work, as the hardlink works a the filesystem level
and Mercurial will be oblivious of that "implementation" details.
However, it will be up to you to preserve that hardlink in sync. Other
program like your test editor, or generation of the file might break
that hardlink, Even `hg update` could end up doing that.
So it depends of what kind of file it is, how and how often it gets
updated. And depending on that you might want to setup hooks to make
sure the two "file" (i.e. file system path) still point to the same
"content" (i.e. file system inode) before committing, or after update.
Can you tell use more about this file?
On 10/6/25 17:27, Uwe Brauer via Mercurial wrote:
> Hi
>
>
> Here is the scenario. I have a single file that I would like to use in two repositories:
>
> ```
> repo1
> repo2
> ```
>
> Both repositories will, however, be pushed to Helix.
>
> Using symbolic links between the files is of little use, since the content of the symbolic link will not be transmitted.
>
> I therefore considered using hard links. Is this a sensible approach?
>
> I would prefer to avoid employing a subrepository, as I have encountered problems with them in the past.
>
>
> Thanks
>
> Uwe Brauer
>
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at lists.mercurial-scm.org
> https://lists.mercurial-scm.org/mailman/listinfo/mercurial
--
Pierre-Yves David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20251007/4e4b8aed/attachment.htm>
More information about the Mercurial
mailing list