threads / discuss / 47011

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

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

## tl;dr

One message between Oct 23, 2017 and Oct 23, 2017.

replies: 0people: 1as markdown or json

Yubin Ruan· Oct 23, 2017, 11:27 UTC · lore
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

← back to recent threads