# checking out from branch A to branch B brings along a folder from A. Why

1 messages from 2017-10-23 to 2017-10-23. Participants: Yubin Ruan.
Thread: https://gitlist.dev/t/47011

## Yubin Ruan, 2017-10-23 11:27

Subject: checking out from branch A to branch B brings along a folder from A. Why
Message-ID: <CAJYFCiMJLL-gq5rwHRx1NYZP2iev3g4vXKXh1rDcxW6dCifoJA@mail.gmail.com>
URL: https://gitlist.dev/e/CAJYFCiMJLL-gq5rwHRx1NYZP2iev3g4vXKXh1rDcxW6dCifoJA%40mail.gmail.com

```
Hi,

I got three branch: master, A, B.

I have a directory in branch A: "/path/to/repo/somefolder" (and that
folder is in the working tree, not working directory), but that folder
doesn't exist in either branch B or master. When in branch A, if I do

    $ git checkout B

that "somefolder" will be brought to branch B (this is weird)

But when I do

    $ git checkout master

then it will not be brought along (this works as expected)

That is weird because AFAIK checkout out to branch B will not bring
any file from the working tree from other branch.

I have tried to updated git from 1.5.4.7 to 2.9.

I am in a CI server so there might be some mis-configuration. What
should I check for? Has anyone ever encountered such a situation?

Yubin

```
