Shammer's Philosophy

My private adversaria

How to display diff between local branch and remote branch of GIT?

Before commit

Just git diff can display the difference like below.

$ git diff
diff --git a/my-elisps.el b/my-elisps.el
index a7c3ee8..e4044da 100644
--- a/my-elisps.el
+++ b/my-elisps.el
@@ -161,7 +161,7 @@
                    ">\n"))
     (insert (concat "<div id=\""
                    element-id
-                   "\" style=\"display:none;chear:both;\" class=\""
+                   "\" style=\"display:none;clear:both;\" class=\""
                    element-class
                    "\"></div>"))))
 (define-key global-map (kbd "C-c i") 'insert-visible-change-element)
$ 

After commit

Once commit done, there is no output with git diff.

$ git commit -v -a -m "Bug fix of insert-visible-change-element"
[master fae5af0] Bug fix of insert-visible-change-element
 1 file changed, 1 insertion(+), 1 deletion(-)
$ 
$ git diff
$

In this case, should do "git diff remote/origin/master".

$ git diff remotes/origin/master
diff --git a/my-elisps.el b/my-elisps.el
index a7c3ee8..e4044da 100644
--- a/my-elisps.el
+++ b/my-elisps.el
@@ -161,7 +161,7 @@
                    ">\n"))
     (insert (concat "<div id=\""
                    element-id
-                   "\" style=\"display:none;chear:both;\" class=\""
+                   "\" style=\"display:none;clear:both;\" class=\""
                    element-class
                    "\"></div>"))))
 (define-key global-map (kbd "C-c i") 'insert-visible-change-element)
$ 

I wonder why remote/origin/master. I am not sure what is the difference between remote and master. I cloned local branch from master. I think master and remote is the same in my repository.