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

Re: Is it possible to have a file shared between branches?

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 12, 2010, 09:33 UTC
Message-ID
<m2p51dd1af81004120233o95640769zb14a63a4bdb29a76@mail.gmail.com>
In-Reply-To
<alpine.OSX.2.01.1004121058390.52293@kroll.spectro.jussieu.fr>
On Mon, Apr 12, 2010 at 09:10, Eric LEBIGOT <Eric.Lebigot@normalesup.org> wrote:
Show 11 quoted lines
> Is it possible for git to track a single file that would be shared accross
> branches?  Case in point: a to-do list file that describes what has to be
> done in all the branches; it can be convenient to put all the things that
> have to be done in a single, shared file, while keeping this to-do list in
> sync with the code (so that it lists what has been done, and what remains to
> be done).  Committing in a branch would in effect also commit the shared
> file in the other branches (another possibility may be to have in effect
> many "trees" in a single git directory, with a specific tree for the to-do
> list).
>
> Is this something git can do?

Sure. But it doesn't do it automatically. To do it you'd write a little script to cherry-pick any commit to the TODO across all your branches on commit.

That's now how I'd do it. I'd just add a TODO submodule or just always work on the TODO in one branch.

Previous: Eric LEBIGOTNext: Wincent Colaiuta
Message 2 of 7 in “Is it possible to have a file shared between branches?”
  1. Eric LEBIGOTApr 12, 2010
  2. Ævar Arnfjörð BjarmasonApr 12, 2010
  3. Wincent ColaiutaApr 12, 2010
  4. Jakub NarebskiApr 12, 2010
  5. Eric LEBIGOTApr 12, 2010
  6. Wincent ColaiutaApr 12, 2010
  7. Junio C HamanoApr 12, 2010

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.