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

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 16, 2009, 21:28 UTC
Message-ID
<alpine.DEB.1.00.0906162326210.26154@pacific.mpi-cbg.de>
In-Reply-To
<4A37EEC5.4020007@gmail.com>
Hi,
On Tue, 16 Jun 2009, Martin Nordholts wrote:
> 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
This detaches the HEAD.
>  git branch newbranch
This gives the detached HEAD a name.
> is equivalent to
> 
>  git branch newbranch origin/somebranch

In this case, we know exactly from which remote branch the new branch was created.

The difference?

In the former case, origin can be long gone by the time the new branch is created. And you have to make sure that once we switch away (by whatever means) from the detached HEAD, the tracking information is deleted.

All in all, your wish sounds rather fragile and thus not desirable to me.

Ciao, Dscho

P.S.: Disclaimer skipped as we talked on IRC about it, and I am actually surprised you still think it would be a sensible idea.

Previous: Martin Nordholts
Message 2 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.