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

Re: git-branch, older repos and more confusion

From
Jeff King <peff@peff.net>
Date
Apr 12, 2007, 05:21 UTC
Message-ID
<20070412052118.GA30459@coredump.intra.peff.net>
In-Reply-To
<46a038f90704112205g53ab4750s673f449ee40165b4@mail.gmail.com>
On Thu, Apr 12, 2007 at 05:05:24PM +1200, Martin Langhoff wrote:
> Which means I'll have to write a little list that goes "if your git is
> version X, do this, if it's version Y do that". :-(

Yes, that is frustrating. If you are just working with master/origin, I think you can get away with it due to the default configuration created, but otherwise I'm not sure it's avoidable. I seem to recall a thread about this a few months ago (between me and Bill Lear, maybe?), but I don't recall that there was any especially good conclusion.

Show 14 quoted lines
> For example, creating a new "custom" branch on the repo used to be
> trivial and left us with a setup that was simple and safe. For
> example, if you wanted to work on a custom v1.9:
> 
> - cg-clone <repo>#v1.9-maint mydir
> - cd mydir
> - cg-branch-chg origin <repo>#1.9-clientname
> - cg-push     ## this creates the new head on the repo
> - cg-branch-add v1.9-maint <repo>#v1.9-maint mydir
> 
> and from there onwards cg-update / cg-push worked on the custom
> branch, and cg-update v1.9-maint would merge from the maint branch.
> 
> Any hints as to how to run such workflow on v1.5.x?
This will seem like repetition, but it's like this:
  git-clone <repo> mydir
  cd mydir
  git-checkout --track -b v1.9-clientname origin/v1.9-maint
  git-push origin v1.9-clientname    # to create the new head remotely

When you do a git-pull without arguments from the v1.9-clientname branch, it will first do a fetch of origin (grabbing the entire state, including the v1.9-maint branch) and then merge in origin's v1.9-maint.

When you do a push without arguments, it will push every head you have in common with origin. Because we pushed the v1.9-clientname branch once, it was created and will be part of subsequent pushes.

-Peff
Previous: Martin LanghoffNext: Martin Langhoff
Message 6 of 9 in “git-branch, older repos and more confusion”
  1. Martin LanghoffApr 12, 2007
  2. Jeff KingApr 12, 2007
  3. Sam VilainApr 12, 2007
  4. Martin LanghoffApr 12, 2007
  5. Martin LanghoffApr 12, 2007
  6. Jeff KingApr 12, 2007
  7. Martin LanghoffApr 12, 2007
  8. Martin LanghoffApr 12, 2007
  9. Jeff KingApr 12, 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.