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

Re: Switching heads and head vs branch after CVS import

From
Junio C Hamano <junkio@cox.net>
Date
Aug 15, 2005, 00:40 UTC
Message-ID
<7vmznkav80.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<46a038f905081417241f9598cc@mail.gmail.com>
Martin Langhoff <martin.langhoff@gmail.com> writes:
> After having done a cvs import of Moodle using git-cvsimport-script
> all the cvs branches show up as heads. How do I switch heads within a
> checkout? cogito doesn't seem to be able to, and I'm unsure on how to
> do it with git.
The documentation may be quite sketchy on this front.

I do not speak for Pasky, so Cogito may treat them a little differently, but at the core GIT level, you can treat branches and heads synonymously.

What you have recorded in .git/refs/heads/frotz file is the SHA1 object name of the commit that is at the top of "frotz" branch. When your .git/HEAD symlink points at refs/heads/nitfol, your working tree is said to be on "nitfol" branch.

You switch branches by using "git checkout". You can create a new branch using "git checkout -b newbranch commit-id". You examine which branch you are on by "readlink .git/HEAD". As you already found out, you can merge branches with "git resolve master other-branch 'comment'". The last one is briefly covered by the tutorial.

Previous: Martin LanghoffNext: Linus Torvalds
Message 2 of 16 in “Switching heads and head vs branch after CVS import”
  1. Martin LanghoffAug 15, 2005
  2. Junio C HamanoAug 15, 2005
  3. Linus TorvaldsAug 15, 2005
  4. Martin LanghoffAug 15, 2005
  5. Linus TorvaldsAug 15, 2005
  6. Sven VerdoolaegeAug 15, 2005
  7. Matthias UrlichsAug 15, 2005
  8. Martin LanghoffAug 15, 2005
  9. Wolfgang DenkAug 15, 2005
  10. Matthias UrlichsAug 15, 2005
  11. Sven VerdoolaegeAug 15, 2005
  12. Linus TorvaldsAug 15, 2005
  13. Martin LanghoffAug 15, 2005
  14. Wolfgang DenkAug 15, 2005
  15. Linus TorvaldsAug 15, 2005
  16. Johannes SchindelinAug 15, 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.