git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
CRConor Rafferty <conor.rafferty@altmore.co.uk>
Date
Dec 31, 2008, 02:22 UTC
Message-ID
<BB5F02FD3789B54E8964D38D6775E718242D35@ALTMORE-SVR.altmore.local>
 

-----Original Message----- wtf is wrong with

git checkout <something>
??

** It doesn't reliably put the files that were in that revision into the working directory - a fairly major flaw, for what I'm using SCM for (and 80% of the market IMHO)

if you must have
git checkout <something> <paths>
then instead use

git checkout <something> <paths> git clean

** hmm, might try this - obviously as per Daniels post there is some undefined interaction happenign with the index, to screw up the working directory. I presume clean flushes the index?

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).

** don't care, I'll be removing them from working dir anyhow before doing a rollback

On Tue, Dec 30, 2008 at 4:15 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:

Show 6 quoted lines
> 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.
Show 5 quoted lines
> 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
Show 21 quoted lines
> 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
>
Next: Jeff Whiteside
Message 1 of 11 in “RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]”
  1. Conor RaffertyDec 31, 2008
  2. Jeff WhitesideDec 31, 2008
  3. Boyd Stephen Smith Jr.Dec 31, 2008
  4. Daniel BarkalowDec 31, 2008
  5. Daniel BarkalowDec 31, 2008
  6. ZorbaDec 31, 2008
  7. Sitaram ChamartyDec 31, 2008
  8. Daniel BarkalowDec 31, 2008
  9. Sitaram ChamartyDec 31, 2008
  10. ZorbaDec 31, 2008
  11. Sitaram ChamartyDec 31, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.