Page 1 of 1

problem with changing branches

Posted: October 18th, 2017, 4:02 pm
by sterig
Hi,

I have a problem:
If I want to switch between two branches I am getting an error saying:
'Cannot switch to T17-dev because there are uncommitted changes. Commit or undo your changes before you switch branches. See the Output window for details.'

Why?

Note that I am also getting this message when I am opening VS and trying to start working in a branch.

Thanks.

Re: problem with changing branches

Posted: October 18th, 2017, 10:08 pm
by albinopapa
You must go to the Changes tab, write a commit message and commit before switching branches. If it allowed you to switch before committing, your changes would be lost. Compiling the chili framework for instance would cause .shh files to be created and git will try tracking those added files as changes, so then you must commit the changes before switching.

Re: problem with changing branches

Posted: October 19th, 2017, 1:55 am
by chili
Yeh, if you have changes, commit them, or undo them, as necessary. Then you can freely switch branches.

Re: problem with changing branches

Posted: October 19th, 2017, 4:24 pm
by sterig
chili wrote:Yeh, if you have changes, commit them, or undo them, as necessary. Then you can freely switch branches.
The problem is that I did not change anything.

Re: problem with changing branches

Posted: October 19th, 2017, 5:58 pm
by albinopapa
Did you check the Changes tab in Team Explorer?

To be fair, there have been times that VS says there are changes to commit but the changes tab is empty. The only way I've been able to fix this is with a third party git program ( could also use the git commands or the git gui ). I don't know the commands and I don't use Git Gui, I use TortoiseGit ( thanks Luis or maybe it was Cameron ) when VS git breaks.