RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 30 Dec 2008, Conor Rafferty wrote:

> I don't understand, sorry. I thought I'd already removed all files from
> the local tree, in the $ rm *.* move just above the checkout  

That removes them from the filesystem, but they're still in the index. And 
"git checkout <something> ." first gets everything that *is* in "." in
<something> into the index, and then gets everything from "." in the index 
into the filesystem.

I suppose it is questionable as to whether it ought to copy paths that 
aren't in versionA from the index into the filesystem.

To see this in a bit more detail, do:

$ rm *.*
$ git status
(notice that the deletes are in the "won't be committed" section)

Now, "git checkout <path>" will discard any changes in the "won't be 
committed" section for that path. Maybe "git checkout versionA <path>" 
should only discard changes that are in the "won't be committed" section 
for filenames that match that path and are in versionA (or are 
*different* in versionA and not removed?), but I think it's an area where, 
if you're expecting any particular behavior out of that command, you're 
likely to be surprised in some way in some situation.

	-Daniel
*This .sig left intentionally blank*
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux