0


I have 2 branches, A and B. Branch B is a sub branch of A.
I have made several changes to B including adding new directories. When I add/commit/push all in B, then switch to A ( checkout), SOME , but not all, of the new files are still showing in my filesystem. Typically they would disappear from the filesystem as they are not part of that branch.
When I run a git status on A, it says it is clean , even though there are CLEARLY files that were not in there previously nor are showing up in github.com. There doesn't seems to be any logic as to what is kept.
Any ideas?

hogsolo
  • 13,565
  • 6
  • 24
  • 25
  • For any of the files that shouldn't still be there, please post a transcript of `git ls-tree A: -- path/to/file`, `git ls-tree A~: -- path/to/file, `git ls-tree B: -- path/to/file`, git ls-tree B~: -- path/to/file` and `git ls-files path/to/file`? Thanks. – jthill May 28 '14 at 18:52
  • possible duplicate of [Git checkout branch leaves directory tree from other branch](http://stackoverflow.com/questions/18068888/git-checkout-branch-leaves-directory-tree-from-other-branch) – Derek May 28 '14 at 18:52

1 Answers1

0

Yes this is a duplicate, I searched but didn't find that other answer. Basically you do a "git clean -fd" after checking out branch A.

Git checkout/pull doesn't remove directories?

Community
  • 1
  • 1
hogsolo
  • 13,565
  • 6
  • 24
  • 25