Windows Hard Link Today

Example: mklink /H "C:\ProjectA\notes.txt" "C:\Backups\original_notes.txt" Hard Links vs. Other Link Types

copy file.txt file_backup.txt # Wrong: uses 2x space mklink /H file_backup.txt file.txt # Right: zero extra space

The problem arises when someone else later sees backup.txt , assumes it's a copy, and deletes it—wiping the only remaining link to that data. windows hard link

Think of a file on your hard drive as a person and a "hard link" as a name badge. A person can wear multiple name badges—"John," "Manager," and "Dad"—but they are still just one person.

But Windows has a secret: the . With a hard link, a single file can appear in multiple folders simultaneously, without duplicating any data. Change one, and the others update instantly. Delete one, and the others remain untouched. Example: mklink /H "C:\ProjectA\notes

The utility of hard links extends beyond mere file organization. Their primary benefit is storage efficiency and data integrity.

Git internally uses hard links for its "alternate object stores" feature. When you clone a local repository with --reference , Git creates hard links to shared objects to save space. A person can wear multiple name badges—"John," "Manager,"

A hard link is not a backup. It protects against accidental deletion only if you leave at least one link intact.

In this guide, you'll learn exactly what hard links are, how to create them, when to use them, and the critical pitfalls to avoid.