Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference b/w a $ git pull and $ hg pull

Tags:

git

mercurial

Steve Losh: A Guide to Branching in Mercurial -

Mercurial will push/pull all branches by default, while git will push/pull only the current branch.

I wonder if my understanding is right:

It occurs to me that when I do a git pull I actually do fetch from all branches but the merge happens only with the current branch that I am sitting on. This is very close to mercurial where a pull gets me everything from the remote; but does not merge anything yet.

In mercurial a push sends everything, but an explicit updateis needed to merge things back. I am not quite sure on git' behavior of the push operation.

like image 977
Vaibhav Bajpai Avatar asked Oct 11 '22 05:10

Vaibhav Bajpai


1 Answers

In Git, you have to pull/push all the branches one by one. Thus, you can work on local branches without messing up the server.

You can specify each time which branch you want to pull/push on : git push origin master means you want to push your branch master on the one at origin, which is often the "default" server.

like image 95
Cydonia7 Avatar answered Nov 27 '22 16:11

Cydonia7