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.