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

Re: Switching between branches

From
Matthias Urlichs <smurf@smurf.noris.de>
Date
Apr 21, 2005, 14:12 UTC
Message-ID
<pan.2005.04.21.14.12.46.905838@smurf.noris.de>
In-Reply-To
<20050421073123.GD31910@pasky.ji.cz>
Hi, Petr Baudis wrote:
Show 9 quoted lines
> Hello,
> 
>> Perhaps it's a naive question, but how do I switch between branches?  I
>> mean an equivalent of "svn switch" or "cvs update -r branch" that would
>> reuse the existing working directory.
> 
> you can't. There was 'git update' (and intermediate never-committed 'git
> switch'), but I decided not to support it for now, since I don't have any
> compelling usage case for it.

I do -- I have a project which builds several slightly-customized versions, and I'd like to keep the generated objects around if possible.

So I just build one version, then "git cancel FOO" to the next version, and let the make rules take care of rebuilding what needs to be rebuilt.

("cancel" already does most of the job anyway, i.e. cleanup stuff which the build process might have changed that it shouldn't have.)

Cf. the last of the patches I've just mailed to the list.
-- 
Matthias Urlichs
Previous: Petr BaudisNext: Petr Baudis
Message 3 of 4 in “Switching between branches”
  1. Pavel RoskinApr 21, 2005
  2. Petr BaudisApr 21, 2005
  3. Matthias UrlichsApr 21, 2005
  4. Petr BaudisApr 21, 2005

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.