Subject: Re: [BUG] git checkout <branch> allowed with uncommitted changes

From: arQon <[email-masked]>
Date: Thu, 13 Oct 2011 16:17:51 +0000 (UTC)

Victor Engmark <victor.engmark <at> terreactive.ch> writes:
> 1. `checkout master` and commit the fix there, then shift back and
> continue working

I absolutely agree. And it's far more common than any of us would like.
My point is, you *can't* do this in git without first staging your current branch
via either commit or stash, or you risk changes bleeding between the branches
and/or work being lost irretrievably. This is not something that you would
expect, and as you say:

> The second most important thing a VCS should do is not destroy any of your
uncommitted work unless you tell it to

... which is exactly what git does, and why I have a problem with it.
But the response here is uniformly "that's just how git is", so obviously it's
something you learn to become aware of over time, and avoid. It's not going to
get "fixed", because people who are used to git don't see it as a bug, so I just
have to decide whether I can live with it or not.