Git diff for added file

This question already has an answer here:

  • How do I show the changes which have been staged? 13 answers

  • You can check

    git diff --cached -- yourFile
    

    That will diff between HEAd and the index.

    http://images.abizern.org.s3.amazonaws.com/365git/Feb11/Git%20Diff%202.png

    (from 365git.tumblr.com)

    The -- helps separating the command from the parameters

    See more on the double hyphen syntax in "Deleting a badly named git branch".

    链接地址: http://www.djcxy.com/p/50866.html

    上一篇: 如何从git中的索引中删除文件?

    下一篇: 用于添加文件的Git diff