What is the git diff command for?

7

I asked this question shortly here on SOPT .

There were some questions, and then the user @AnthonyAccioly asked me to ask this question.

What is the git diff ?

    
asked by anonymous 12.08.2015 / 17:21

1 answer

9

diff is for checking differences between commits, files, and directory trees .

Examples:

  • git diff : Displays all the differences between your local copy and the synchronized index;
  • git diff –cached : Displays all the differences between the synchronized index and the last commit ;
  • git diff HEAD : Displays all the differences between your local copy and the last commit committed;
12.08.2015 / 17:27