开发者

How do I see changes in the git index?

开发者 https://www.devze.com 2023-01-10 01:23 出处:网络
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

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

精彩评论

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