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

Re: git branch --switch?

From
RHRene Herman <rene.herman@gmail.com>
Date
Apr 17, 2007, 15:47 UTC
Message-ID
<4624EC18.4000500@gmail.com>
In-Reply-To
<4624EAAA.6040000@gmail.com>
On 04/17/2007 05:41 PM, Rene Herman wrote:
> On 04/17/2007 04:31 PM, Brian Gernhardt wrote:
Show 25 quoted lines
>> However, I'm somewhat confused as to why you'd want HEAD and the 
>> working directory to get out of sync.
> 
> Thank you for the answer. Well, as said, it's not essential, but I was 
> just now rebuilding a repo and have a few branches that I all want to be 
> based on the same revision. Say, branch a, b and c, based on v2.6.20.
> 
> git clone -l -s -n <a local linux repo> local
> git checkout -b v20 v2.6.20
> git branch a
> git branch b
> git branch c
> 
> Step 1, 3, 4 and 5 of this are nearly instantaneous but 2 isn't -- this 
> repo sits on a P1 with 64M of memory and a disk doing 8 M/s which is 
> probably the only reason I thought asking about it was a good idea in 
> the first place...
> 
> You'd be quite right in saying that there isn't much point; if I want to 
> now start populating branch a, I have to "git checkout a" anyway, and 
> that action _will_ now be instantaneous. If I'd replaced 2 with:
> 
> git branch --create-and-set-as-current v20 v2.6.20
> 
> then I will not have won any time until that 6th "git checkout a" step.
s/until/after/
> The checkout of v20 was superfluous in this though, and I just expected 
> I should be able to skip that. It fitted my mental model...
Rene.
Previous: Rene HermanNext: Lars Hjemli
Message 9 of 18 in “git branch --switch?”
  1. Rene HermanApr 17, 2007
  2. Alex RiesenApr 17, 2007
  3. Rene HermanApr 17, 2007
  4. Brian GernhardtApr 17, 2007
  5. Alex RiesenApr 17, 2007
  6. Rene HermanApr 17, 2007
  7. Brian GernhardtApr 17, 2007
  8. Rene HermanApr 17, 2007
  9. Rene HermanApr 17, 2007
  10. Lars HjemliApr 17, 2007
  11. Rene HermanApr 17, 2007
  12. Randal L. SchwartzApr 17, 2007
  13. Rene HermanApr 17, 2007
  14. Lars HjemliApr 17, 2007
  15. Rene HermanApr 17, 2007
  16. Rene HermanApr 17, 2007
  17. Linus TorvaldsApr 17, 2007
  18. Rene HermanApr 17, 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.