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

[OCLUG-Tech] with "git stash {pop, apply}", what is the function of "--keep-index"?

  • Subject: [OCLUG-Tech] with "git stash {pop, apply}", what is the function of "--keep-index"?
  • From: "Robert P. J. Day" <rpjday [ at ] crashcourse [ dot ] ca>
  • Date: Fri, 25 Sep 2015 05:38:17 -0400 (EDT)
  another presumably simple "git stash" question -- when doing either
a "pop" or "apply", what is the purpose of the "--keep-index" option?
from the man page:

"If the --index option is used, then tries to reinstate not only the
working tree’s changes, but also the index’s ones."

  my interpretation of that is that, if my stash was saved with
changes already staged in the index, then popping or applying will
attempt to (re)stage those changes into the index.

  but i've tried simple examples both using and not using
"--keep-index" during the pop and i see no difference in the final
effect. what is it supposed to do?

rday


-- 

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

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