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

2 messages from 2009-06-16 to 2009-06-16. Participants: Martin Nordholts, Johannes Schindelin.
Thread: https://gitlist.dev/t/19832

## Martin Nordholts, 2009-06-16 19:13

Subject: git-branch: Actually using the current branch as default start-point
Message-ID: <4A37EEC5.4020007@gmail.com>
URL: https://gitlist.dev/e/4A37EEC5.4020007%40gmail.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

```

## Johannes Schindelin, 2009-06-16 21:28

Subject: Re: git-branch: Actually using the current branch as default start-point
Message-ID: <alpine.DEB.1.00.0906162326210.26154@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0906162326210.26154%40pacific.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.

```
