# Ambiguous branch names...

2 messages from 2014-02-16 to 2014-02-16. Participants: Ingo Rohloff, Duy Nguyen.
Thread: https://gitlist.dev/t/35893

## Ingo Rohloff, 2014-02-16 20:34

Subject: Ambiguous branch names...
Message-ID: <20140216203439.GA15538@localhost>
URL: https://gitlist.dev/e/20140216203439.GA15538%40localhost

```
Hello,

while trying out git (version 1.7.9.5), I did this:

git clone -- ssh://myserver/~rohloff/git/w1.git w1

So I just cloned a test repository.
The in the cloned "w1" repository I executed:

git branch origin/master
git branch remotes/origin/master
git branch refs/remotes/origin/master

I now have got three *local* branches with the above names, which
now seems to make it impossible to refer to the master branch
from the "origin" *remote* repository.

Wouldn't it make sense to forbid such names for local branches ?
For example to enforce some rules like a local branch name *must not*
start with "remotes/" or "refs/" ?

so long
  Ingo

```

## Duy Nguyen, 2014-02-16 22:47

Subject: Re: Ambiguous branch names...
Message-ID: <CACsJy8Cfv0-QQBX=Psm28wWbpM8Jra4POPUGgsFbn6EB2Yk9Zw@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8Cfv0-QQBX%3DPsm28wWbpM8Jra4POPUGgsFbn6EB2Yk9Zw%40mail.gmail.com
In-Reply-To: <20140216203439.GA15538@localhost>

```
On Mon, Feb 17, 2014 at 3:34 AM, Ingo Rohloff <lundril@gmx.de> wrote:
> Hello,
>
> while trying out git (version 1.7.9.5), I did this:
>
> git clone -- ssh://myserver/~rohloff/git/w1.git w1
>
> So I just cloned a test repository.
> The in the cloned "w1" repository I executed:
>
> git branch origin/master
> git branch remotes/origin/master
> git branch refs/remotes/origin/master
>
> I now have got three *local* branches with the above names, which
> now seems to make it impossible to refer to the master branch
> from the "origin" *remote* repository.
>
> Wouldn't it make sense to forbid such names for local branches ?
> For example to enforce some rules like a local branch name *must not*
> start with "remotes/" or "refs/" ?

See http://thread.gmane.org/gmane.comp.version-control.git/242096/focus=242181.
The proposal basically is you can't create those branches without -f.
-- 
Duy

```
