Can git switch branch without the modification
- by hguser
I have a project which have completed the basic models(at master), then I commit them.
Then I create two branchs user and product using:
git checkout -b user
git checkout -b product
git checkout user
Then I add the codes in the user branch, but I found that I have to make some changes for the basic models.
Then I switch to master:
git checkout master
But I found that the modification I made in the user branch is visible in the working directory now.
How to avoid this? Since the change to master and modification will be frequency.