Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: Git: Unexpected behaviour?

From: Martin von Zweigbergk <hidden>
Date: 2016-06-15 22:52:28

On Sat, Nov 12, 2011 at 11:37 AM, Junio C Hamano [off-list ref] wrote:
"J.V." [off-list ref] writes:
quoted
OK so "work tree" is a new term for me.  I thought we were in isolated
sandboxes called "branches" and changes made in a branch would stay in
that branch regardless.
Do not think of "branches" as isolated _sandboxes_.

Rather, "branches" are where the independent states are to be _recorded_.
I think I was confused about this when learning Git too. I friend of
mine made the following argument, which I agree with and which I haven
seen on the list before:

Either you want the modifications to stay on the branch, or you want
them to carry over to the branch you are checking out. In the former
case, you would want Git to fail if there are modifications (that you
might have forgotten you made). In the latter case, you would want
"git checkout -m". The current behavior is somewhere in between. It is
not clear to me if there is a use case where the current behavior is
better (from the user's point of view) than either failing or
"checkout -m".

It is obviously too late to change this now, though.

Martin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help