Git

master vs origin/master

Take a clone of a remote repository and rungit branch -a(to show all the branches git knows about). It will probably look something like this:

* master
  remotes/origin/HEAD -
>
 origin/master
  remotes/origin/master

Here,masteris a branch in the local repository.remotes/origin/masteris a branch namedmasteron the remote namedorigin. You can refer to this as eitherorigin/master, as in:

git diff origin/master..master

You can also refer to it asremotes/origin/master:

git diff remotes/origin/master..master

These are just two different ways of referring to the same thing (incidentally, both of these commands mean "show me the changes between the remotemasterbranch and mymasterbranch).

remotes/origin/HEADis thedefault branchfor the remote namedorigin. This lets you simply sayorigininstead oforigin/master.

Last updated

Was this helpful?