I think I’m on the right track to understand the basic concepts of git.
I’ve already set up and cloned a remote repository. I also created a server side empty repository, and linked my local repository to it.
My problem is that I don’t understand the difference between:
- origin/master vs. remotes/origin/master
As far as I have understood, master is a local branch, and remotes/origin/master is a remote one.
But what exactly is origin/master?
Take a clone of a remote repository and run
git branch -a(to show all the branches git knows about). It will probably look something like this: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:You can also refer to it as
remotes/origin/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 remote
masterbranch and mymasterbranch).remotes/origin/HEADis thedefault branchfor the remote namedorigin. This lets you simply sayorigininstead oforigin/master.