I've created two branches in Git:
git branch F1
git branch F2
Next, I switch over to F1:
git checkout F1
I rename my UnitTests
directory to Tests
:
git mv .\UnitTests .\Tests
git commit . -m "Moving unit tests to Tests directory"
At this point, I have a master
branch with a UnitTests
directory, an F2 branch with a UnitTests
directory and a F1
branch with a Tests
directory. So, I switch over to F2
:
git checkout F2
When I do this, I now see the UnitTests
directory added back, but I also see the Tests
directory (From the F1 branch) still there. It even has all the same files.
I can force it to be removed by running:
git clean -fd
However, I'm wondering why remnants from the old branch are lingering around. I've looked at a few other potential duplicates, but all of them note cases where my move was not yet committed. I clearly committed the move to F1 before switching branches.
Any ideas? I'm running git version 1.9.2.msysgit.0
on Windows.
It is because you have files or directories (could be empty) that git ignore (hidden or explicit ignored) in the UnitTests
directory
Therefore, git wouldn't delete these files so he keeps them in the directory.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments