# Branch name with space

2 messages from 2008-12-02 to 2008-12-02. Participants: Le, Shawn O. Pearce.
Thread: https://gitlist.dev/t/16562

## Le, 2008-12-02 17:34

Subject: Branch name with space
Message-ID: <4935719A.8000705@distributel.ca>
URL: https://gitlist.dev/e/4935719A.8000705%40distributel.ca

```
Hi, there,

I tried to rename a branch to a new name with space in it. It complained :
git-branch -M 'test 1' or test\ 1
fatal: Invalid branch name: refs/heads/test 1

Is there a way the get round this problem?

Thanks!

Le

```

## Shawn O. Pearce, 2008-12-02 18:03

Subject: Re: Branch name with space
Message-ID: <20081202180344.GW23984@spearce.org>
URL: https://gitlist.dev/e/20081202180344.GW23984%40spearce.org
In-Reply-To: <4935719A.8000705@distributel.ca>

```
Le <le_wen@distributel.ca> wrote:
> I tried to rename a branch to a new name with space in it. It complained :
> git-branch -M 'test 1' or test\ 1
> fatal: Invalid branch name: refs/heads/test 1
>
> Is there a way the get round this problem?

Don't put spaces in branch names.  They aren't permitted.  Use
an underscore ('_') or a hypen ('-').

-- 
Shawn.

```
