2

So I have the following situation:

# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   ../push-test.xml
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   ../push-test.xml

I would like to print contents of staged push-test.xml. How to achieve it?

Roman Saveljev
  • 2,544
  • 1
  • 21
  • 20
  • Have you changed `push-test.xml` since staging it? If not, `cat ../push-test.xml` will do it. – ssube Aug 10 '13 at 17:49
  • @peachykeen That's already answered in the question: `../push-test.xml` is also mentioned in "Changes not staged for commit" –  Aug 10 '13 at 17:50
  • @peachykeen Yes, I have changed push-test.xml since staging as `git status` shows promptly – Roman Saveljev Aug 10 '13 at 17:50
  • How did you end up with this?I think you did `git stash pop` and the stash had a version of the same file that was already staged for commit. – Cratylus Aug 10 '13 at 17:52
  • 3
    @Cratylus This is a normal state for git, it's what happens when you modify a file, do `git add`, don't commit, and make further modifications to the file. –  Aug 10 '13 at 17:53
  • @hvd Yeah, you are right - it is a duplicate. I googled with wrong words – Roman Saveljev Aug 10 '13 at 17:53
  • @hvd:Ah, right! I am new to git. I think the OP needs this http://stackoverflow.com/questions/348170/undo-git-add-before-commit?rq=1 – Cratylus Aug 10 '13 at 17:56
  • Voted to close as the duplicate.. – Roman Saveljev Aug 10 '13 at 18:09

0 Answers0