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,master
is a branch in the local repository.remotes/origin/master
is a branch namedmaster
on 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 remotemaster
branch and mymaster
branch).
remotes/origin/HEAD
is thedefault branch
for the remote namedorigin
. This lets you simply sayorigin
instead oforigin/master
.
Last updated
Was this helpful?