I'm newbie and starting use git for project. I not notice the difference of "Branch" and "origin/Branch" Please guide me.
In Git, "origin" is a shorthand name for the remote repository that a project was originally cloned from. More precisely, it is used instead of that original repository's URL - and thereby makes referencing much easier.
You shouldn't commit anything directly to the master branch. Instead do all your work on the develop branch and then merge develop into master whenever you have a new public release. That's the same way you create a branch but without the -b .
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.
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.
Branch
is your local branch and origin/Branch
is your remote branch.
To make sure which branches are local or remote just use the following git commands.
$ git branch # see local branches
$ git branch -r # see remote branches
$ git branch -a # see local and remote branches
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With