If I run git diff
I see the changes in my working tree, and if I run git diff --staged
(alternatively --cached
) then I see the changes that are staged (w/ git add
) but is there a way with git diff
to see all in one go?
simply typing git status gives you a list of staged files, a list of modified yet unstaged files, and a list of untracked files. @houtanb, git status shows you a diff. (It doesn't show you all staged files).
If you just want to see the diff without committing, use git diff to see unstaged changes, git diff --cached to see changes staged for commit, or git diff HEAD to see both staged and unstaged changes in your working tree.
The git diff command shows the differences between the files in two commits or between your current repository and a previous commit.
If you mean the changes between the working tree and your HEAD commit (i.e. both staged and unstaged changes together) this is just done with:
git diff HEAD
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With