Why do I need hg update after hg pull while in git I'm doing only git pull
In git to pull and use the latest changes to my local repository I'm using git pull.
In hg, I also use hg pull but it prints then
run 'hg update' to get a working copy
I do run hg update but I wonder why is this difference from git?
git mercurial
add a comment |
In git to pull and use the latest changes to my local repository I'm using git pull.
In hg, I also use hg pull but it prints then
run 'hg update' to get a working copy
I do run hg update but I wonder why is this difference from git?
git mercurial
add a comment |
In git to pull and use the latest changes to my local repository I'm using git pull.
In hg, I also use hg pull but it prints then
run 'hg update' to get a working copy
I do run hg update but I wonder why is this difference from git?
git mercurial
In git to pull and use the latest changes to my local repository I'm using git pull.
In hg, I also use hg pull but it prints then
run 'hg update' to get a working copy
I do run hg update but I wonder why is this difference from git?
git mercurial
git mercurial
asked Oct 9 '13 at 11:05
Alexander KulyakhtinAlexander Kulyakhtin
32.7k2888143
32.7k2888143
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
The other answers don't actually answer the question, which is: why don't Git and Mercurial work the same? Is there a philosophical difference?
In Mercurial, pull is the opposite of push: it syncs the local repo with a remote repo without touching the working copy. So it's more consistent.
In Git, pull is a fetch plus a merge, or a pull plus an update in Mercurial terms. Usually this is what you want. So it's more efficient.
The Distributed Version Control University talk has a slide at the 4-minute mark that clearly demonstrates the way Mercurial works. Michael Ernst's Version control concepts and best practices has a similar diagram (included below):

add a comment |
Because git pull internally performs git fetch and git merge, whereas hg pull only does what git fetch does. Just do hg pull -u instead. See also this command equivalence table.
Git fetch and mercurial pull do the same thing. Mercurial fetch and git pull do the same thing.
Of course Mercurial and Git use different data structures internally, so at some point there is a technical difference in the implementation details. If you really care deeply about it, just compare the documentation for hg pull and git fetch. The Git wording is more technical and verbose, but in the end it is the same.
add a comment |
To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f19270303%2fwhy-do-i-need-hg-update-after-hg-pull-while-in-git-im-doing-only-git-pull%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
The other answers don't actually answer the question, which is: why don't Git and Mercurial work the same? Is there a philosophical difference?
In Mercurial, pull is the opposite of push: it syncs the local repo with a remote repo without touching the working copy. So it's more consistent.
In Git, pull is a fetch plus a merge, or a pull plus an update in Mercurial terms. Usually this is what you want. So it's more efficient.
The Distributed Version Control University talk has a slide at the 4-minute mark that clearly demonstrates the way Mercurial works. Michael Ernst's Version control concepts and best practices has a similar diagram (included below):

add a comment |
The other answers don't actually answer the question, which is: why don't Git and Mercurial work the same? Is there a philosophical difference?
In Mercurial, pull is the opposite of push: it syncs the local repo with a remote repo without touching the working copy. So it's more consistent.
In Git, pull is a fetch plus a merge, or a pull plus an update in Mercurial terms. Usually this is what you want. So it's more efficient.
The Distributed Version Control University talk has a slide at the 4-minute mark that clearly demonstrates the way Mercurial works. Michael Ernst's Version control concepts and best practices has a similar diagram (included below):

add a comment |
The other answers don't actually answer the question, which is: why don't Git and Mercurial work the same? Is there a philosophical difference?
In Mercurial, pull is the opposite of push: it syncs the local repo with a remote repo without touching the working copy. So it's more consistent.
In Git, pull is a fetch plus a merge, or a pull plus an update in Mercurial terms. Usually this is what you want. So it's more efficient.
The Distributed Version Control University talk has a slide at the 4-minute mark that clearly demonstrates the way Mercurial works. Michael Ernst's Version control concepts and best practices has a similar diagram (included below):

The other answers don't actually answer the question, which is: why don't Git and Mercurial work the same? Is there a philosophical difference?
In Mercurial, pull is the opposite of push: it syncs the local repo with a remote repo without touching the working copy. So it's more consistent.
In Git, pull is a fetch plus a merge, or a pull plus an update in Mercurial terms. Usually this is what you want. So it's more efficient.
The Distributed Version Control University talk has a slide at the 4-minute mark that clearly demonstrates the way Mercurial works. Michael Ernst's Version control concepts and best practices has a similar diagram (included below):

answered Mar 16 '14 at 23:14
MikelMikel
18.9k54760
18.9k54760
add a comment |
add a comment |
Because git pull internally performs git fetch and git merge, whereas hg pull only does what git fetch does. Just do hg pull -u instead. See also this command equivalence table.
Git fetch and mercurial pull do the same thing. Mercurial fetch and git pull do the same thing.
Of course Mercurial and Git use different data structures internally, so at some point there is a technical difference in the implementation details. If you really care deeply about it, just compare the documentation for hg pull and git fetch. The Git wording is more technical and verbose, but in the end it is the same.
add a comment |
Because git pull internally performs git fetch and git merge, whereas hg pull only does what git fetch does. Just do hg pull -u instead. See also this command equivalence table.
Git fetch and mercurial pull do the same thing. Mercurial fetch and git pull do the same thing.
Of course Mercurial and Git use different data structures internally, so at some point there is a technical difference in the implementation details. If you really care deeply about it, just compare the documentation for hg pull and git fetch. The Git wording is more technical and verbose, but in the end it is the same.
add a comment |
Because git pull internally performs git fetch and git merge, whereas hg pull only does what git fetch does. Just do hg pull -u instead. See also this command equivalence table.
Git fetch and mercurial pull do the same thing. Mercurial fetch and git pull do the same thing.
Of course Mercurial and Git use different data structures internally, so at some point there is a technical difference in the implementation details. If you really care deeply about it, just compare the documentation for hg pull and git fetch. The Git wording is more technical and verbose, but in the end it is the same.
Because git pull internally performs git fetch and git merge, whereas hg pull only does what git fetch does. Just do hg pull -u instead. See also this command equivalence table.
Git fetch and mercurial pull do the same thing. Mercurial fetch and git pull do the same thing.
Of course Mercurial and Git use different data structures internally, so at some point there is a technical difference in the implementation details. If you really care deeply about it, just compare the documentation for hg pull and git fetch. The Git wording is more technical and verbose, but in the end it is the same.
edited Nov 19 '18 at 12:45
DaveInCaz
3,22931938
3,22931938
answered Oct 9 '13 at 11:15
sschuberthsschuberth
17.2k463105
17.2k463105
add a comment |
add a comment |
To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.
add a comment |
To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.
add a comment |
To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.
To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.
answered Oct 15 '13 at 11:50
MarkMark
42929
42929
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f19270303%2fwhy-do-i-need-hg-update-after-hg-pull-while-in-git-im-doing-only-git-pull%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown