Open Laboratory for Technocrats

Grab the developer role, learn concepts & prepare with senior software engineers to get solutions for problems in a software job. Coding and Programming Solutions crafted for you.

GIT > origin master and origin/master

What is the difference between the two commands as they seems similar while they are same same but different.

Descriptive image found here


Lets have a look on these commands while using with GIT
git pull origin master :
git pull origin master works in a manner that it will go to remote branch called "master" and then it will pull the changes from that remote branch and it will try to merge it to the local branch on which the developer is working on.

git pull origin master -> Goes on to remote Branch "master" -> Fetches the changes -> Merges the changes to Local Branch ( Local Active Branch)
Now lets have a look into the other command which seems similar but diffrent.

git pull origin/master :
git pull origin/master works in a manner that it will go to local branch called "master" and then it will pull the changes from that local branch and it will try to merge it to the local branch on which the developer is working on.

git pull origin/master -> Goes on to Local Branch "master" -> Fetches the changes -> Merges the changes to Local Branch ( Local Active Branch)

Top #3 Articles

Most Read