What is the difference between git diff
and git difftool
?
I see that I can edit the configuration file for git to easily change the external tool used when I invoke git difftool
and it seems that git diff
outputs patches to the command line.
Why would I want to use git diff
?
As you and WKPlus said, git difftool
will use an external tool, while git diff
will show the diff directly in the terminal.
To answer your last question about when you would want to use git diff
, you can think some of these ones :
Many other example can be imagined, and maybe you will find some of them yourself using git on daily basis.
git difftool will show you the diff in some tool (for example: vimdiff) and allow you to edit directly.
If you only want to check the changes you just did, I think git diff is more convenient.
It seems like since use vim
can read a file and then why I want to use cat
?
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