Skip to main content
Ctrl+K
 - Home
  • About
  • Installation
  • Guide
  • Extensions
  • News
  • Release Notes
    • Mercurial 7.2 (2026-01-29)
    • Mercurial 7.1 (2025-08-04)
    • Mercurial 7.0 (2025-03-25)
    • Mercurial 6.9 (2024-11-20)
    • Mercurial 6.8 (2024-07-08)
    • Mercurial 6.7 (2024-03-15)
    • Mercurial 6.6 (2023-11-07)
    • Mercurial 6.5 (2023-07-06)
    • Mercurial 6.4 (2023-03-23)
    • Mercurial 6.3 (2022-11-09)
    • Mercurial 6.2 (2022-07-11)
    • Mercurial 6.1 (2022-02-28)
    • Mercurial 6.0 (2021-11-17)
    • Mercurial 5.9 (2021-08-16)
    • Mercurial 5.8 (2021-05-01)
    • Mercurial 5.7 (2021-01-29)
    • Mercurial 5.6 (2020-10-29)
    • Mercurial 5.5 (2020-08-01)
    • Mercurial 5.4 (2020-04-16)
    • Mercurial 5.3 (2020-01-29)
    • Mercurial 5.2 (2019-11-05)
    • Mercurial 5.1 (2019-07-28)
    • Mercurial 5.0 (2019-04-25)
    • Mercurial 4.9 (2019-01-08)
    • Mercurial 4.8 (2018-10-28)
    • Mercurial 4.7 (2018-08-01)
    • Mercurial 4.6 (2017-11-30)
    • Mercurial 4.5 (2018-02-01)
    • Mercurial 4.4 (2017-11-01)
    • Mercurial 4.3 (2017-08-07)
    • Mercurial 4.2 (2017-05-02)
    • Mercurial 4.1 (2017-02-01)
    • Mercurial 4.0 (2016-11-01)
    • Mercurial 3.9 (2016-08-01)
    • Mercurial 3.8 (2016-04-30)
    • Mercurial 3.7 (2016-02-01)
  • Contribute
    • Contribute to hg-website

hg help

  • Commands
  • Additional topics
  • Extensions

More

  • Steering Committee
  • Contribute to hg-website

hg relink

On this page

  • recreate hardlinks between two repositories

hg relink#

recreate hardlinks between two repositories#

hg relink [ORIGIN]

This command is provided by the relink extension.

When repositories are cloned locally, their data files will be hardlinked so that they only use the space of a single repository.

Unfortunately, subsequent pulls into either repository will break hardlinks for any files touched by the new changesets, even if both repositories end up pulling the same changes.

Similarly, passing --rev to "hg clone" will fail to use any hardlinks, falling back to a complete copy of the source repository.

This command lets you recreate those hardlinks and reclaim that wasted space.

This repository will be relinked to share space with ORIGIN, which must be on the same local disk. If ORIGIN is omitted, looks for "default-relink", then "default", in [paths].

Do not attempt any read operations on this repository while the command is running. (Both repositories will be locked against writes.)

Options

--mq

operate on patch repository

On this page
  • recreate hardlinks between two repositories

By Mercurial developers

© Copyright 2025, Mercurial developers.