开发者

How do I see changes in the git index?

Say I do

git add foo.txt

Now, foo's changes are in the index (I'm assuming git was 开发者_Python百科already tracking that file). Now, when I do git diff, I can't see the changes in foo by doing

git diff

Are there some extra things that git diff wants before it shows me those changes?


  • To show unstaged changes only:
git diff
  • To show the staged/cached changes only:
git diff --cached
  • To show both cached and uncached changes, compare the whole working tree to the named commit (HEAD):
git diff HEAD
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜