githubteacher / github-for-developers-sept-2015

practice repo for the Sept 29-30 GitHub for Developers class
12 stars 36 forks source link

what is the difference between origin master and orgin/master #687

Closed bcmatz closed 9 years ago

bcmatz commented 9 years ago

Different syntax, different operation ?

bcmatz commented 9 years ago

:+1:

jaw6 commented 9 years ago

origin is the name of the remote -- it's a default, used by git when initially cloning. When manually adding a remote, you must give it a name, if there's only one remote, it's traditional for developers to call it "origin" as well.

master is the name of a branch -- also a default, used by git when initially creating a new repository. Developers often use master as the name of the main, "production-ready" branch. master is name of the branch, used alone it usually means "the local branch, here on this :computer:" origin/master means "the remote branch, what's currently on :octocat:".

origin master (with a space) is separately specifying the remote and the branch name -- this is used in commands like git push -- git push origin master means: "push the local branch master to a branch also named master on the remote named origin"