I have a very strange problem in my Visual Studio 2017 (latest version is installed) and my GIT repositorys.
Since a few weeks I am able to switch to another branch without the need of commit my code changes.
Example:
- I am working on branch-1 an a add a file
- now am able to change to branch-2
- in branch-2, the new file is also available
That should not work! It makes branches just useless! How can I fix this strange behaviour?
Thanks! Stefan
EDIT: Maybe my example was not the best. I am sure all files are tracked. I try another example:
- I create a new branch "new_feature"
- in this branch I make changes to the existing feature.aspx file
- the feature.aspx is listet in the "uncommited changes" area correctly
- then I change back to the master branch
- I expact to get back the unchanged feature.aspx (as it has worked for serveral month before)
- but the featue.aspx includes my changes and is listed under "uncommited changes" of master branch
In each branch - the code files are the same.
UPDATE:
I found out the following: If I commit the changes in the feature.aspx in new_feature branch and switch back to the master branch - then I get back the unchange feature.aspx as I would expact it. But this is a potential error source! So it seems that I just want to get back the restriction, that I can not change the branch, if there are uncommited changes in the current branch. Where can I find the this setting? Is it a feature of VisualStudio or is it a feature of GIT?