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

Re: Resetting working files

From
AGAaron Gray <aaronngray.lists@googlemail.com>
Date
May 31, 2009, 16:50 UTC
Message-ID
<9719867c0905310950x153db8efw179a8a10ac3f4640@mail.gmail.com>
In-Reply-To
<20090531163225.GE3674@debian.b2j>
2009/5/31 bill lam <cbill.lam@gmail.com>
Show 20 quoted lines
>
> On Sun, 31 May 2009, Peter Baumann wrote:
> >       echo modified >> a.txt
> >       git add a.txt
> >       git checkout -- a.txt           (1)
> >
> >       git checkout HEAD -- a.txt      (2)
> >
> >
> > (1) This will do nothing to your file 'a.txt' in your workdir because
> >     the index and the workdir are identical
> >
> > (2) This will reset your file to the state before you run that bogus
> >     echo modified >> a.txt   comand
>
> I still do not understand what index is.
> 1. is index an replica of the committed tree
> 2. is index only transient in that its content will be reset once
>   committed?
> 3. or other ?
I think index is HEAD or a revision hash. Am I correct ?
Aaron
Previous: Peter BaumannNext: Nicolas Sebrecht
Message 5 of 8 in “Resetting working files”
  1. Aaron GrayMay 31, 2009
  2. Dirk SüsserottMay 31, 2009
  3. Aaron GrayMay 31, 2009
  4. Peter BaumannMay 31, 2009
  5. Aaron GrayMay 31, 2009
  6. Nicolas SebrechtMay 31, 2009
  7. Aaron GrayMay 31, 2009
  8. Alex RiesenMay 31, 2009

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.