home | list info | list archive | date index | thread index

[OCLUG-Tech] can i "git checkout" an earlier version of a file *only* into working directory?

  • Subject: [OCLUG-Tech] can i "git checkout" an earlier version of a file *only* into working directory?
  • From: "Robert P. J. Day" <rpjday [ at ] crashcourse [ dot ] ca>
  • Date: Tue, 6 Oct 2015 05:36:06 -0700 (PDT)
  another picky git question ... if i'm working with the linux kernel
source, i know i can check out an earlier version of, say, the
top-level Makefile with something like:

 $ git checkout v4.0 -- Makefile

however, that command checks out the v4.0 version of the Makefile into
both the working directory *and* the index. is there an option to
check the file out only in the working directory? it seems like a
simply variation, but i don't see a checkout option to do that. and,
yes, it's easy enough to do the checkout, then "reset" the index, but
doing it with a single checkout command would be useful.

  am i overlooking something trivial?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================