I am trying to switch branch. I have created one branch called nilay using:
git checkout nilay
I can switch to this branch very easily. I can also switch to master branch.
I am trying to edit all of my code in my branch nilay, but in my visual code editor, when I am trying to checkout, I am getting this error:
error: Your local changes to the following files would be overwritten by checkout:
I want to switch my branches; for example when I use:
git checkout nilay
I want my code of this branch as it is, and when I change it, it should stay there. And when I switch to master using:
git checkout master
I should see the master code, but when I am switching I am getting errors. What is the best way to switch branches?