Git-fetch-file – Sync files from other repos with commit tracking and safety

12 andrewmcwatters 2 8/6/2025, 10:45:27 PM github.com ↗

Comments (2)

Bukhmanizer · 3m ago
I’m imagining some sort of art project where people try and figure out the most complicated software you can make entirely off files stitched together from different repos.
andrewmcwatters · 53m ago
Hi HN, thanks for sending this to the front page.

I'm finding myself needing some resources from other projects in a way that ecosystem-specific dependency management isn't going to help, or I'd be pulling in too many files.

Submodules aren't the answer, and some other existing git user-defined commands don't seem to do what I need either.

I want a file from another repository, and the ability to pin it, and track it in the future, or just always be up-to-date by using the default HEAD commit value set in `.git-remote-files`.

    git fetch-file add https://github.com/octocat/Hello-World README
    git fetch-file pull
Let's me track the README file from the octocat/Hello-World repository, and pull down the file. A record of it is then saved in `.git-remote-files`.

Let me know if you have any questions!