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

Re: how to combine two clones in a collection

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 10, 2007, 02:35 UTC
Message-ID
<alpine.LFD.0.999.0707091923300.3412@woody.linux-foundation.org>
In-Reply-To
<20070709222250.GA8007@piper.oerlikon.madduck.net>
On Tue, 10 Jul 2007, martin f krafft wrote:
Show 5 quoted lines
> 
> I am now ready to move to using git for most of my everyday work,
> but I am still unsure how to tackle one specific aspect of it, for
> which I used svn:externals in the past. I know about git
> subprojects, but these aren't what I want, really.

I really _think_ that what you want is to just use separate branches, if I understand correctly. That makes it really easy to just have both lines of development (both the "trunk" and your "debian" one) in one git repository.

Of course, especially if you want to continue to work the way you probably worked with SVN (ie you are used to seeing those two branches as two separate directories), that means that while you can (and should) see it as a single git project, you'd normally end up just having two copies of that project: they'd _both_ have two branches, but they'd just en dup having different branches checked out.

Of course, after you get comfy enough with the setup, you might end up just deciding that you might as well just switch branches around in a single repository (which is what a lot of git users end up doing), but at least initially, it's probably easier from a conceptual standpoint to just have the two branches checked out in separate copies of the repos.

> With SVN, I would have a directory with two external entries:
> 
>   upstream.trunk svn+ssh://svn.upstream.org/path/to/trunk
>   upstream.trunk/debian svn+ssh://svn.debian.org/svn/pkg/trunk/debian

So in git, you'd have just one "project" with two branches - perhaps just called "upstream" and "debian".

Of course, with git, that single "project" can then exist in a distributed manner in many different places, and having two copies with different branches checked out would just happen to be the one that most closely resembles your current situation.

> How can I do this with git? I am aware that maybe the best way would
> be to use git-svn to track the upstream branch remotely and to add
> ./debian in a separate git branch (and to stop using SVN and switch
> to git for ./debian)

I don't think you'd have to stop using SVN. Just continue to track the "upstream" branch with git-svn, and then you can merge in the upstream into your "debian" branch that also has all the debian-specific stuff.

(And no, I don't know what the standard debian package management setup looks like, but I would hope that your extra stuff would be just a few files and package descriptions, and obviously any of the local debian changes to the project).

		Linus
Previous: martin f krafftNext: martin f krafft
Message 2 of 16 in “how to combine two clones in a collection”
  1. martin f krafftJul 9, 2007
  2. Linus TorvaldsJul 10, 2007
  3. martin f krafftJul 10, 2007
  4. Junio C HamanoJul 10, 2007
  5. martin f krafftJul 10, 2007
  6. Martin LanghoffJul 10, 2007
  7. Linus TorvaldsJul 10, 2007
  8. martin f krafftJul 10, 2007
  9. Brian GernhardtJul 10, 2007
  10. Kalle PokkiJul 10, 2007
  11. Brian GernhardtJul 10, 2007
  12. Robin RosenbergJul 10, 2007
  13. martin f krafftJul 11, 2007
  14. Johannes SchindelinJul 11, 2007
  15. martin f krafftJul 11, 2007
  16. Jakub NarebskiJul 11, 2007

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.