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

Re: Branching a subset of your working tree

From
Chris Packham <judge.packham@gmail.com>
Date
Feb 22, 2010, 21:44 UTC
Message-ID
<a038bef51002221344ic966a22x939824fa31020bff@mail.gmail.com>
In-Reply-To
<ron1-F4D522.13070422022010@news.gmane.org>
On Mon, Feb 22, 2010 at 1:07 PM, Ron Garret <ron1@flownet.com> wrote:
Show 7 quoted lines
> What is the recommended way to create a branch that contains a subset of
> your working tree?  The use case is creating a distribution branch that
> will be pushed out to a server and I only want to include files that are
> ready to be released.
>
> Thanks,
> rg

Well we did something similar at $dayjob. We had a repository consisting of code we wanted to release under the LGPL and code we wanted to keep private.

We ended up using git filter-branch to create 2 new repositories with commit histories one for the GPL stuff and one for the proprietary stuff. We then started working on them as 2 separate repositories.

This is possibly a different use case for your situation. We were happy to wear the fact that our developers would have to re-clone the 2 repos but it sounds like you may want to be able to submit common code when it is logically complete.

Another suggestion would be to use branches instead of separate repos. This similar to how git.git is run. i.e. "master" is the stable branch, "next" is the proving ground for features that have been cooked sufficiently and "pu" is where new topics get introduced (disclaimer: this may be an inaccurate representation of how git.git is _actually_ run but you get the gist). This of course assumes you are happy for the unstable code to be visible.

Previous: Ron Garret
Message 2 of 2 in “Branching a subset of your working tree”
  1. Ron GarretFeb 22, 2010
  2. Chris PackhamFeb 22, 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.