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)

Related Posts:

  • Git - Interview Questions and Answers There are a lot of different questions which needs to be prepared for the interview as it depends on the level of the candidate also. As there is ap… Read More
  • 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 … Read More
  • GIT Tips git add -p -p allow to step through each change for commit or not git log -5 --pretty --oneline 5 lastest commits on their own lin… Read More

Top #3 Articles

Most Read