# BUG: Renaming a branch checked out in a different work tree

3 messages from 2017-03-29 to 2017-03-29. Participants: Eyal Lotem, Jonathan Nieder, Andreas Schwab.
Thread: https://gitlist.dev/t/45539

## Eyal Lotem, 2017-03-29 18:02

Subject: BUG: Renaming a branch checked out in a different work tree
Message-ID: <CALA94fPqm5UnYBwqZ5fDJ=DL_9EaZeRfqHB5ZzUQt11FSz4ZMA@mail.gmail.com>
URL: https://gitlist.dev/e/CALA94fPqm5UnYBwqZ5fDJ%3DDL_9EaZeRfqHB5ZzUQt11FSz4ZMA%40mail.gmail.com

```
git version: 2.7.4
installed from Ubuntu repos:
Ubuntu Version: 1:2.7.4-0ubuntu1

When renaming a branch checked out in a different work tree, that work
tree's state is corrupted. Git status in that work tree then reports
itself being on the "initial commit" with all files being in the
staging area.

--
Eyal

```

## Jonathan Nieder, 2017-03-29 18:40

Subject: Re: BUG: Renaming a branch checked out in a different work tree
Message-ID: <20170329184018.GV31294@aiede.mtv.corp.google.com>
URL: https://gitlist.dev/e/20170329184018.GV31294%40aiede.mtv.corp.google.com
In-Reply-To: <CALA94fPqm5UnYBwqZ5fDJ=DL_9EaZeRfqHB5ZzUQt11FSz4ZMA@mail.gmail.com>

```
(+cc: Kazuki Yamaguchi --- thanks for writing the fix!)
Hi Eyal,

Eyal Lotem wrote:

> git version: 2.7.4
> installed from Ubuntu repos:
> Ubuntu Version: 1:2.7.4-0ubuntu1
>
> When renaming a branch checked out in a different work tree, that work
> tree's state is corrupted. Git status in that work tree then reports
> itself being on the "initial commit" with all files being in the
> staging area.

I believe this is fixed by v2.8.3~42^2~1 (branch -m: update all
per-worktree HEADs, 2016-03-27).

Thanks and hope that helps,
Jonathan

```

## Andreas Schwab, 2017-03-29 18:43

Subject: Re: BUG: Renaming a branch checked out in a different work tree
Message-ID: <87d1czditz.fsf@linux-m68k.org>
URL: https://gitlist.dev/e/87d1czditz.fsf%40linux-m68k.org
In-Reply-To: <CALA94fPqm5UnYBwqZ5fDJ=DL_9EaZeRfqHB5ZzUQt11FSz4ZMA@mail.gmail.com>

```
On Mär 29 2017, Eyal Lotem <eyal.lotem@gmail.com> wrote:

> git version: 2.7.4
> installed from Ubuntu repos:
> Ubuntu Version: 1:2.7.4-0ubuntu1
>
> When renaming a branch checked out in a different work tree, that work
> tree's state is corrupted. Git status in that work tree then reports
> itself being on the "initial commit" with all files being in the
> staging area.

Fixed since 2.8.3.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```
