Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference "origin master" vs "origin/master"

Tags:

git

What is the difference between a space and a slash when running git commands?

I sometimes see

git push origin master (which is a space)

and other times I see

git rebase origin/master (which uses a slash)

What is the difference in this convention? Is it that the slash notation accesses a local cached copy whereas the space version actually reaches out to the remote repo (github) ?

like image 511
Homan Avatar asked Oct 04 '11 00:10

Homan


People also ask

What is difference between origin master and master?

Master: This is a branch name where we first initiate git and then we use to make commits. And the changes in the master can pull/push into a remote. origin/master: This is a remote branch, which has a local branch named master on a remote named origin.

What is the difference between origin and origin master?

The term "git origin master" is used in the context of a remote repository. It is used to deal with the remote repository. The term origin comes from where repository original situated and master stands for the main branch. Let's understand both of these terms in detail.

What is origin master and origin head?

HEAD is not the latest revision, it's the current revision. Usually, it's the latest revision of the current branch, but it doesn't have to be. master is a name commonly given to the main branch, but it could be called anything else (or there could be no main branch). origin is a name commonly given to the main remote.

What does origin master means in git push origin master?

With git push origin master you tell git to push all of the commits in the currently checked out local branch (i.e. from your file system) to the remote repo identified by the name origin on its remote branch named master .


1 Answers

This is not a "convention". The former is two separate arguments in different positions with different meanings to git push, and the latter is a single argument which identifies the remote-tracking branch origin/master.

like image 182
Lily Ballard Avatar answered Sep 29 '22 12:09

Lily Ballard