git diff - How can I get content of a file from git index? -


i have file has been added local repository. i've modified in working tree, git-status shows me file modified. know file content kept in index before stage file.

i can think of 2 ways of doing that:

  1. revert patch generated git-diff, , apply on file in working tree
  2. use git-checkout-index, point temporary file , read content there

is there easier way?

use : prefix access objects in current index (staged not yet commited).

git show :file 

see gitrevisions more information.


Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

java - Getting corefrences with Standard corenlp package -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -