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

RE: git branch

From
TMTim Mazid <timmazid@hotmail.com>
Date
May 23, 2011, 12:36 UTC
Message-ID
<SNT124-W21FCFAE653C2B81DD980BFC4720@phx.gbl>
In-Reply-To
<BANLkTim_L0M2oFV383+5n7-X_KQTdd3BAg@mail.gmail.com>
Show 9 quoted lines
> From: gbuday@gmail.com
>
> > I'm not sure if I'm following you correctly, but with Git you need to
> > check out your branch after creating it. Run git checkout install_2.0
> > after you have created it.
>
> Yes, that sounds reasonable. I did not know it was necessary to "switch to it".
>
> - Gergely
Hi Gergely,

The way that git branches work is that they "point" at commits. When you do a "git commit", git updates the branch to point at the new commit you just created. In this way, you can have a multitude of branches and be working on only one at a time.

N.B. If you want to create a branch and "switch" (checkout) to it at once, you can pass the "-b" option to checkout, thus: "git checkout -b new-branch-name"; this will create a new branch named "new-branch-name" and immediately switch to it.

Tim.
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
 		 	   		  
Previous: Gergely Buday
Message 4 of 4 in “git branch”
  1. Gergely BudayMay 23, 2011
  2. Marcus KarlssonMay 23, 2011
  3. Gergely BudayMay 23, 2011
  4. Tim MazidMay 23, 2011

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.