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

Keeping two repos in sync

From
DCDavid Chanters <david.chanters@googlemail.com>
Date
Sep 9, 2012, 08:12 UTC
Message-ID
<CACffvTqt9UHw1wLVDZ=PDqJuktcD8M7uUfnnuDZ5cf9gwxsSqA@mail.gmail.com>
Hi all,
I'm wondering how best to go about this problem.  I've got two
separate git repositories -- one is a portable version which I'll call
"portable", the other is part of a BSD project, which I'll call "bsd".
 Both repositories have the same set of *conceptual* files in them,
it's just that the portable repository has additional files which are
not found in the bsd repository.  It should be noted that the bsd
repository is an automatically managed cvsexport clone of a CVS
repository -- but I don't think this matters here, as we're just
talking about two git repositories.

The "workflow" if you can call it that, is commits happen in the bsd repository and are then put in the portable repo. At the moment, I am using git grafts to do this. The important point to remember here is the two repositories DO NOT have any common history to them -- it's just that where the files are the same in both the bsd and portable repository I can see and hence tell git, where to graft the two master branches from each repository and for me to merge bsd:master -> portable:master.

However, I am wondering how best to handle this situation. It's pretty convoluted -- not to mention the fact that git grafts are never permanent. What I'd like is for some "safe" way of setting up an initial git graft which tied the two master branches between bsd and portable to reflect changes on bsd:master not on portable:master and then for me to treat those two branches as though they shared common history so that I can merge one to the other. Unfortunately, what I'm doing at the moment is each time changes happen to bsd:master, I'm having to reset the git graft each time; and since that operation is a local one, it makes things rather awkward in a shared repository situation as I am the sole person who can perform these merges.

I'm guessing I could rebase at some point and push those changes out? I'm just wondering how other people handle this situation or if it's just unique to me?

Kindly,
David
Next: Andreas Schwab
Message 1 of 4 in “Keeping two repos in sync”
  1. David ChantersSep 9, 2012
  2. Andreas SchwabSep 9, 2012
  3. David ChantersSep 9, 2012
  4. Andreas SchwabSep 9, 2012

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.