It seems like I have inadvertently modified my git config such that when I switch from branchA to master all changes are automatically merged to master. This happens without
When you are switching branch and the files are only locally modified, Git will not give you the warning / message ( and will merge the changes into the other branch). For example, you have your repo on master
, create a branch temp
, have a local modification on the file. Now, when you switch to master
you won't get the message. If on the other hand you makes changes in temp
and commit them ( that is temp
diverges from master
) and then you have local modifications, it will give you that message when you switch to master