I have a file which has been already added to my local repository. I've modified it in the working tree, so git status shows me the file as modified. I would like to know what is the file content kept in the index before I stage the file.
git status
I can think of two ways of doing that:
git diff
git checkout-index
Is there an easier way?
Use the : prefix to access objects in the current index (staged but not yet commited).
:
git show :file
See the gitrevisions manual for more information.
1.4m articles
1.4m replys
5 comments
56.9k users