Running two git commands in parallel

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












What happens if two git pull command are run simultaneously in the same directory?







share|improve this question
























    up vote
    0
    down vote

    favorite












    What happens if two git pull command are run simultaneously in the same directory?







    share|improve this question






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      What happens if two git pull command are run simultaneously in the same directory?







      share|improve this question












      What happens if two git pull command are run simultaneously in the same directory?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 18 at 10:19









      porton

      9581020




      9581020




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          git does file locking to prevent corrupting the repository. You may get messages like



          error: cannot lock ref 'refs/remotes/origin/develop': is at 2cfbc5fed0c5d461740708db3f0e21e5a81b87f9 but expected 36c438af7c374e5d131240f9817dabb27d2e0a2c
          From github.com:myrepository
          ! 36c438a..2cfbc5f develop -> origin/develop (unable to update local ref)
          error: cannot lock ref 'refs/remotes/origin/master': is at b9a3f6cf9dafc30df38542e5e51ae4842c50814d but expected 5e6174b3c7071c840effeda6c708d6aef36f7c6a
          ! 5e6174b..b9a3f6c master -> origin/master (unable to update local ref)


          from the git processes that fail to get the lock. That is all.



          If the two git pull processes are slightly out of sync with each other, the effect will be the same as running the command twice.






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424927%2frunning-two-git-commands-in-parallel%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            git does file locking to prevent corrupting the repository. You may get messages like



            error: cannot lock ref 'refs/remotes/origin/develop': is at 2cfbc5fed0c5d461740708db3f0e21e5a81b87f9 but expected 36c438af7c374e5d131240f9817dabb27d2e0a2c
            From github.com:myrepository
            ! 36c438a..2cfbc5f develop -> origin/develop (unable to update local ref)
            error: cannot lock ref 'refs/remotes/origin/master': is at b9a3f6cf9dafc30df38542e5e51ae4842c50814d but expected 5e6174b3c7071c840effeda6c708d6aef36f7c6a
            ! 5e6174b..b9a3f6c master -> origin/master (unable to update local ref)


            from the git processes that fail to get the lock. That is all.



            If the two git pull processes are slightly out of sync with each other, the effect will be the same as running the command twice.






            share|improve this answer
























              up vote
              3
              down vote



              accepted










              git does file locking to prevent corrupting the repository. You may get messages like



              error: cannot lock ref 'refs/remotes/origin/develop': is at 2cfbc5fed0c5d461740708db3f0e21e5a81b87f9 but expected 36c438af7c374e5d131240f9817dabb27d2e0a2c
              From github.com:myrepository
              ! 36c438a..2cfbc5f develop -> origin/develop (unable to update local ref)
              error: cannot lock ref 'refs/remotes/origin/master': is at b9a3f6cf9dafc30df38542e5e51ae4842c50814d but expected 5e6174b3c7071c840effeda6c708d6aef36f7c6a
              ! 5e6174b..b9a3f6c master -> origin/master (unable to update local ref)


              from the git processes that fail to get the lock. That is all.



              If the two git pull processes are slightly out of sync with each other, the effect will be the same as running the command twice.






              share|improve this answer






















                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                git does file locking to prevent corrupting the repository. You may get messages like



                error: cannot lock ref 'refs/remotes/origin/develop': is at 2cfbc5fed0c5d461740708db3f0e21e5a81b87f9 but expected 36c438af7c374e5d131240f9817dabb27d2e0a2c
                From github.com:myrepository
                ! 36c438a..2cfbc5f develop -> origin/develop (unable to update local ref)
                error: cannot lock ref 'refs/remotes/origin/master': is at b9a3f6cf9dafc30df38542e5e51ae4842c50814d but expected 5e6174b3c7071c840effeda6c708d6aef36f7c6a
                ! 5e6174b..b9a3f6c master -> origin/master (unable to update local ref)


                from the git processes that fail to get the lock. That is all.



                If the two git pull processes are slightly out of sync with each other, the effect will be the same as running the command twice.






                share|improve this answer












                git does file locking to prevent corrupting the repository. You may get messages like



                error: cannot lock ref 'refs/remotes/origin/develop': is at 2cfbc5fed0c5d461740708db3f0e21e5a81b87f9 but expected 36c438af7c374e5d131240f9817dabb27d2e0a2c
                From github.com:myrepository
                ! 36c438a..2cfbc5f develop -> origin/develop (unable to update local ref)
                error: cannot lock ref 'refs/remotes/origin/master': is at b9a3f6cf9dafc30df38542e5e51ae4842c50814d but expected 5e6174b3c7071c840effeda6c708d6aef36f7c6a
                ! 5e6174b..b9a3f6c master -> origin/master (unable to update local ref)


                from the git processes that fail to get the lock. That is all.



                If the two git pull processes are slightly out of sync with each other, the effect will be the same as running the command twice.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 18 at 10:24









                Kusalananda

                103k13202318




                103k13202318






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424927%2frunning-two-git-commands-in-parallel%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay