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

Re: (cogito) Branch offf from older commit?

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 14, 2005, 17:03 UTC
Message-ID
<Pine.LNX.4.58.0508140950270.3553@g5.osdl.org>
In-Reply-To
<20050814155005.6492A353BBF@atlas.denx.de>
On Sun, 14 Aug 2005, Wolfgang Denk wrote:
>
> Is there (in cogito) a way to  start  a  branch  off  from  an  older
> commit?

You should be able to just use the git commands, and cogito should be perfectly happy.

IOW, if you do
	git checkout -b newbranch <starting-point-sha1>

you'll switch to a "newbranch" that was created at the starting point, and as far as I can tell, this is all very cogito-friendly indeed. So now you can work in that "newbranch" - commit things, do anything you want, and all with cogito (ie it's only this one raw git command you need to set things up, after that you're back in cogito-land).

You can switch back with "git checkout master" (again, I don't think cogito does the local git branches yet, but once you've switched back you're golden), and if you're in the "master" branch, you can merge with your new-branch with

	git resolve master newbranch "Merge my work on xyz"
or similar.

And always remember "gitk --all", since that's a very useful thing to visualize where you are.

> 	-> cg-seek 024447b186cca55c2d803ab96b4c8f8674363b86

No, cg-seek doesn't start a new branch, so the result is "locked". You can't commit on top of the seek-point, because the branch you are in already _has_ a child of that point.

(Actually, these days cg-seek does use a fixed local git branch for the seek target, so that's not _technically_ true any more. I suspect Pasky is working on exposing the general local branch interfaces)

		Linus
Previous: Wolfgang Denk
Message 2 of 2 in “(cogito) Branch offf from older commit?”
  1. Wolfgang DenkAug 14, 2005
  2. Linus TorvaldsAug 14, 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.