I am not sure how did it happen, but now when I make a new branch with this command
git checkout -b new-branch
and make some changes in the new-branch, all those changes will also appear in master. However, it did not used to happen before.
I am not sure how did it happen, but now when I make a new branch with this command
git checkout -b new-branch
and make some changes in the new-branch, all those changes will also appear in master. However, it did not used to happen before.
This is expected behavior. Uncommitted changes in your working copy do not belong to any branch, they only live in your working copy. Switching branches will carry these changes over to the other branch, if possible. If not (i.e. the file was changed between both branches), Git will fail with an error message telling you to either commit or stage the changes first.