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

Re: Private/public branches/repos workflow

From
JMJerome Martin <tramjoe.merin@gmail.com>
Date
May 5, 2011, 15:53 UTC
Message-ID
<BANLkTinL6UYAKeBtLnU5+rvwmd+N0dYErw@mail.gmail.com>
In-Reply-To
<201105051535.p45FZQDY019419@no.baka.org>

Thanks for your quick answer! It seems to be a solution a bit alike one I tested before sending my initial question, using : git symbolic-ref HEAD refs/heads/cleanmaster But I am unsure of the result I am getting. Are you suggesting that I should entirely replace my current 'public' branch (there is no important history in there to keep apart from what is already in the other, private, branch) by cleanmaster or that I should keep using three branches and push from that third one (cleanmaster) to the published repo ? One thing I do not understand clearly is why with a detached (I guess this is synonym to orphan ? At least when creating it ?) branch cannot be then merged with the branch that was initially copied to create it and just get the additional commits. Instead, it gets the whole history. Being used to using merge between my public/private branches, I am afraid that using that orphan branch might lead to disaster eventually.

On Thu, May 5, 2011 at 5:35 PM, Seth Robertson <in-gitvger@baka.org> wrote:
Show 25 quoted lines
>
> In message <BANLkTi=TLeePH0JDvnE0XPiCzXFxid9BWQ@mail.gmail.com>, Jerome Martin
> writes:
>
>    Is there any recommended workflow to achieve the result I am looking
>    for ? How are other people doing it ?
>
> Create an orphan branch.  Commit what you want onto it.  Push branch
> to a new repo as master.
>
> git checkout <basesha>
> git checkout --orphan cleanmaster
> git add -A
> git commit -m "base of public release"
> (mkdir ../newrepo; cd ../newrepo; git init --bare)
> git remote add cleanremote ../newrepo
> git push cleanremote cleanmaster:master
>
> You can then cherry pick/rebase from previous branches onto
> cleanmaster any subsequent commits that you want to keep history for.
>
> Another approach might be to finesse a shallow clone to do what you
> want.
>
>                                        -Seth Robertson

-- Jérôme Martin

Previous: Seth RobertsonNext: Junio C Hamano
Message 3 of 8 in “Private/public branches/repos workflow”
  1. Jerome MartinMay 5, 2011
  2. Seth RobertsonMay 5, 2011
  3. Jerome MartinMay 5, 2011
  4. Junio C HamanoMay 5, 2011
  5. Jerome MartinMay 5, 2011
  6. Junio C HamanoMay 6, 2011
  7. Jerome MartinMay 6, 2011
  8. Jerome MartinMay 5, 2011

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.