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

git-branch: Actually using the current branch as default start-point

From
Martin Nordholts <enselic@gmail.com>
Date
Jun 16, 2009, 19:13 UTC
Message-ID
<4A37EEC5.4020007@gmail.com>
Hi

The git-branch documentation states that the start-point defaults to the current branch if omitted. I interpret that to mean that

  git checkout origin/somebranch
  git branch newbranch
is equivalent to
  git branch newbranch origin/somebranch

but that is currently not the case. If you checkout a remote branch then you are not considered to _be_ on the remote branch, so the start-point will behave as if an arbitrary commit was specified, i.e. tracking will not be setup correctly.

This is an easy patch and I have something working, I just need to finalize it. Does this sound like a sane patch to you?

Best regards, Martin Nordholts

Next: Johannes Schindelin
Message 1 of 2 in “git-branch: Actually using the current branch as default start-point”
  1. Martin NordholtsJun 16, 2009
  2. Johannes SchindelinJun 16, 2009

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.