git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jeff Whiteside" <jeff.m.whiteside@gmail.com>
To: "Daniel Barkalow" <barkalow@iabervon.org>
Cc: "Conor Rafferty" <conor.rafferty@altmore.co.uk>,
	"Boyd Stephen Smith Jr." <bss@iguanasuicide.net>,
	git@vger.kernel.org
Subject: Re: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]
Date: Tue, 30 Dec 2008 18:22:07 -0800	[thread overview]
Message-ID: <3ab397d0812301822p34a021b1w6799a9de9a4ffeb4@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.1.00.0812301859100.19665@iabervon.org>

wtf is wrong with

git checkout <something>

??

if you must have

git checkout <something> <paths>

then instead use

git checkout <something> <paths>
git clean

but you will lose other files that aren't part of the repo but are
still in the project's dir (i.e. untracked files).

On Tue, Dec 30, 2008 at 4:15 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:
> 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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  reply	other threads:[~2008-12-31  2:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-30 22:36 for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned] Conor Rafferty
2008-12-30 23:31 ` Boyd Stephen Smith Jr.
2008-12-31  0:15 ` Daniel Barkalow
2008-12-31  2:22   ` Jeff Whiteside [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-12-30 22:55 Conor Rafferty
2008-12-31  0:12 ` Boyd Stephen Smith Jr.
2008-12-31  2:22 ` Sitaram Chamarty
2008-12-31  2:27 Conor Rafferty
2008-12-31  2:35 ` Jeff Whiteside
2008-12-31  2:56 ` Boyd Stephen Smith Jr.
2008-12-31  3:10 ` Daniel Barkalow
2008-12-31  3:49   ` Daniel Barkalow
2008-12-31 12:17     ` Zorba
2008-12-31 13:48       ` Sitaram Chamarty
2008-12-31 16:24       ` Daniel Barkalow
2008-12-31 16:33         ` Sitaram Chamarty
2008-12-31 12:03   ` Zorba
2008-12-31 13:37     ` Sitaram Chamarty
2008-12-31  2:30 Conor Rafferty
2008-12-31  3:40 ` Boyd Stephen Smith Jr.
2008-12-31  4:48   ` Junio C Hamano
2008-12-31  5:21     ` Daniel Barkalow
2008-12-31  6:07       ` Junio C Hamano
2008-12-31 15:14     ` Boyd Stephen Smith Jr.
2008-12-31 10:59 Conor Rafferty
2008-12-31 11:10 Conor Rafferty
2008-12-31 16:00 ` Daniel Barkalow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ab397d0812301822p34a021b1w6799a9de9a4ffeb4@mail.gmail.com \
    --to=jeff.m.whiteside@gmail.com \
    --cc=barkalow@iabervon.org \
    --cc=bss@iguanasuicide.net \
    --cc=conor.rafferty@altmore.co.uk \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).