git checkout experiment is allowed sometimes and sometimes not if I have local changes
- by dorelal
I have a branch called experiment.
git checkout master
echo 'some changes' > a.txt
# now master branch has local changes which are not committed
git checkout experiment
Sometimes I have noticed that I am not allowed to switch to another branch if I have local changes. And sometimes I am allowed to switch to another branch if I have local changes.
What am I missing?