git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Feature Request] Support for sharing root-level files across repositories

From
GOGeorge Ogden <george.ogden.human@gmail.com>
Date
Sep 26, 2025, 08:33 UTC
Message-ID
<CAJ5EAUw_VN4GXiHYJq0et8oZN0L+AHZz+ROLtK3Hxdp3SEL3=g@mail.gmail.com>
Hello Git developers,

Firstly, apologies if this has already been discussed or if there is a way to solve this problem that I am not aware of.

Motivation

Git submodules are very useful for sharing directories between repositories. However, in some workflows, there is a need to share a single file that must live in the repository root.

A concrete example is .pre-commit-config.yaml. I maintain a standard template across many repositories. When I add a new hook or update a version, I have to manually update the file in each repository. I could use a submodule for this, but submodules always appear in a subdirectory — not at the root where tools expect this file.

The same issue arises with other configuration files that need to reside at the top level of a project (linters, CI configs, licenses, etc.).

Proposal

It would be helpful if Git provided a way to share a file across repositories so that it appears at the root of the working tree, without requiring a separate build step, symlink, or copy operation.

I understand there are alternative approaches (subtrees, packages, external tooling), but they all involve extra indirection. Having first-class support within Git for this use case would make it much simpler and more consistent.

Thanks

Thank you for your work maintaining and evolving Git! I would greatly appreciate any feedback on whether this idea has been considered before, and if there are technical reasons it may not fit Git’s model.

Best regards, George Ogden

Next: rsbecker@nexbridge.com
Message 1 of 4 in “[Feature Request] Support for sharing root-level files across repositories”
  1. George OgdenSep 26, 2025
  2. rsbecker@nexbridge.comSep 29, 2025
  3. George OgdenSep 29, 2025
  4. Ben KnobleSep 29, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.