Git doesn't sync files until committed, even if checked out in a different branch
Posted
by
DertWaiter
on Stack Overflow
See other posts from Stack Overflow
or by DertWaiter
Published on 2012-06-22T23:40:05Z
Indexed on
2012/06/23
15:16 UTC
Read the original article
Hit count: 225
Okay, I have git 1.7.11.1 on Windows and I have a local test repository with 2 branches. One is master with index.php and help.php. I then create another branch called slave :)
I run from git bash rm help.php
and it disappears from the folder, but I don't stage anything. I switch to checkout master branch and it is supposed to restore file help.php because it is not modified in the master branch, isn't it?
And it does not do it. When I go back to the slave branch and commit and then switch to checkout master then help.php appears. Is that the way it is supposed to to work? Why?
© Stack Overflow or respective owner