git diff's Examples

This command shows the file differences which are not yet staged.

git diff

This command shows the differences between the files in the staging area and the latest version present.

git diff –staged

This command shows the differences between the two branches mentioned.

git diff [first branch] [second branch]

Shows unstaged file differences

$ git diff

Shows file differences between staging and the last file version

$ git diff --staged

DevOpsSchool
Typically replies within an hour

DevOpsSchool
Hi there 👋

How can I help you?
×
Chat with Us