My IDE is showing me the same files in all branches. Even if I create a new class in branch "A" when I checkout branch "B" the class is there.
I haven't committed or pushed anything. My IDE is PhpStorm.
Any idea?
My IDE is showing me the same files in all branches. Even if I create a new class in branch "A" when I checkout branch "B" the class is there.
I haven't committed or pushed anything. My IDE is PhpStorm.
Any idea?
This is because the new class (such as class.php
) is untracked by git repo.
When you created the new class class.php
in branchA
, but it was not committed in branchA
. When you switched to branchB
, the untracked file class.php
will always show in working directory no matter which branch you checkout.
If you want the class.php
only version controlled in branchA
, you just need to switch to branchA
and commit the changes:
git checkout branchA
git add class.php
git commit -m 'add class.php in branchA'
Now when you switch to branchB
again (git checkout branchB
), you will find the class.php
will disappear.