git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
YRYubin Ruan <ablacktshirt@gmail.com>
Date
Oct 23, 2017, 11:27 UTC
Message-ID
<CAJYFCiMJLL-gq5rwHRx1NYZP2iev3g4vXKXh1rDcxW6dCifoJA@mail.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
Message 1 of 1 in “checking out from branch A to branch B brings along a folder from A. Why”
  1. Yubin RuanOct 23, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.