Using External Tools with Git Diff

If you want to view what has changed since one commit to another, it is quite easy to view the diff.

git diff 5fad06c..0a504fa

You will get something like this:

diff --git a/modules/file_1.erb b/modules/file_1.erb
index 0538da0..6621d93 100644
--- a/modules/file_1.erb
+++ b/modules/file_1.erb
@@ -5,8 +5,8 @@
   // Algo settings
   "Carbo": {
-    "active-instrument": "SGX/NK15",
-    "hedge-instrument": "SGX/NK16",
+    "active-instrument": "SGX/NK17",
+    "hedge-instrument": "SGX/NK18",
     "owner-app-id": "abhi1010",

What if you wanted a use an external tool like meld to view the diff, in a nice beautiful side by side view? You’d have to modify your settings to tell that to git.

git config --global diff.tool meld

Finally, then to view the diff:

git difftool 5fad06c..0a504fa

comments powered by Disqus