Why do I need hg update after hg pull while in git I'm doing only git pull












33















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?










share|improve this question



























    33















    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?










    share|improve this question

























      33












      33








      33


      7






      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?










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 9 '13 at 11:05









      Alexander KulyakhtinAlexander Kulyakhtin

      32.7k2888143




      32.7k2888143
























          3 Answers
          3






          active

          oldest

          votes


















          56














          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):



          Distributed version control






          share|improve this answer































            23














            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.






            share|improve this answer

































              3














              To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.






              share|improve this answer























                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
                });


                }
                });














                draft saved

                draft discarded


















                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









                56














                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):



                Distributed version control






                share|improve this answer




























                  56














                  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):



                  Distributed version control






                  share|improve this answer


























                    56












                    56








                    56







                    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):



                    Distributed version control






                    share|improve this answer













                    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):



                    Distributed version control







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 16 '14 at 23:14









                    MikelMikel

                    18.9k54760




                    18.9k54760

























                        23














                        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.






                        share|improve this answer






























                          23














                          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.






                          share|improve this answer




























                            23












                            23








                            23







                            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.






                            share|improve this answer















                            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.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 19 '18 at 12:45









                            DaveInCaz

                            3,22931938




                            3,22931938










                            answered Oct 9 '13 at 11:15









                            sschuberthsschuberth

                            17.2k463105




                            17.2k463105























                                3














                                To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.






                                share|improve this answer




























                                  3














                                  To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.






                                  share|improve this answer


























                                    3












                                    3








                                    3







                                    To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.






                                    share|improve this answer













                                    To get equivalent git functionality enable the fetch Mercurial extension (bundled with Mercurial distributions), see fetch extension. It will execute a hg pull -u.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Oct 15 '13 at 11:50









                                    MarkMark

                                    42929




                                    42929






























                                        draft saved

                                        draft discarded




















































                                        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.




                                        draft saved


                                        draft discarded














                                        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





















































                                        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







                                        這個網誌中的熱門文章

                                        Academy of Television Arts & Sciences

                                        L'Équipe

                                        1995 France bombings