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

Re: My first git success [not quite]

From: walt <hidden>
Date: 2016-06-15 22:42:16

Linus Torvalds wrote:
On Fri, 13 Jan 2006, walt wrote:
quoted
And it was all so easy I never broke a sweat.  Amazing!
 ...Most people don't bother to 
explain their problems well...
I see I still have a problem:  my mental model of how git
works is still wrong.

I used 'git-checkout -b test' to create a disposable place
to test the patch I was given.

Okay, making sure I'm now sitting in 'test', I apply the
patch to foo.c and do my testing.

Now, intending to delete my 'test' branch, I do git-checkout
master.  My mental model predicts that 'master' should still
be identical to 'origin' because I did the patching in 'test'.
Am I right so far?

The problem I see is that, after switching back to 'master',
foo.c is the patched version, not your original version.  I
figured that the git-checkout would overwrite any changes I
made to foo.c, but that doesn't seem to be the case.  To get
your original version back I had to delete foo.c and do a
git-checkout foo.c (or git-checkout -f master).

So, I clearly don't understand what git-checkout does.  It
doesn't seem to touch the already-checked-out sources at
all, which is what I would expect it to do.

Can someone hit me with the clue-stick here?  Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help