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

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -