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

Re: How make "git checkout <commit> <file>" *not* alter index?

From
JSJike Song <albcamus@gmail.com>
Date
Jan 6, 2009, 06:17 UTC
Message-ID
<df9815e70901052217m3bdb29e4y8f28a1300169c1ea@mail.gmail.com>
In-Reply-To
<20090106051852.GA3278@seberino.org>
On Tue, Jan 6, 2009 at 1:18 PM,  <chris@seberino.org> wrote:
Show 10 quoted lines
> I want to pull an old version of a file into my local directory and make it
> appear like work I haven't added to index yet...
>
>
> So how modify
>
>
> git checkout <commit> <file>
>
> to do this?
I have a stupid way to do this:
 $ git show v2.6.12:Makefile > Makefile
 $ git diff --cached  /* no outputs */
Ugly but seems work.
-- 
Thanks,
Jike
Previous: chris@seberino.orgNext: Junio C Hamano
Message 2 of 4 in “How make "git checkout <commit> <file>" *not* alter index?”
  1. chris@seberino.orgJan 6, 2009
  2. Jike SongJan 6, 2009
  3. Junio C HamanoJan 6, 2009
  4. chris@seberino.orgJan 7, 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.