problem with changing branches

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
sterig
Posts: 6
Joined: September 27th, 2017, 7:30 am

problem with changing branches

Post by sterig » October 18th, 2017, 4:02 pm

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.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: problem with changing branches

Post by albinopapa » October 18th, 2017, 10:08 pm

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.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: problem with changing branches

Post by chili » October 19th, 2017, 1:55 am

Yeh, if you have changes, commit them, or undo them, as necessary. Then you can freely switch branches.
Chili

sterig
Posts: 6
Joined: September 27th, 2017, 7:30 am

Re: problem with changing branches

Post by sterig » October 19th, 2017, 4:24 pm

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.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: problem with changing branches

Post by albinopapa » October 19th, 2017, 5:58 pm

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.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply