merging git with vim without the automerged MERGED












1














I want to use vim (fugitive possibly) to merge my conflicts, but I hate the automerged conflict markers. I'm looking for something like



|-------------------------------|
| | | |
| LOCAL | HEAD | REMOTE |
| | | |
|-------------------------------|
| |
| clean head to merge |
| changes into |
|-------------------------------|


How do I set this up?










share|improve this question






















  • Does this link help? Or this one?
    – romainl
    Mar 1 '13 at 7:49
















1














I want to use vim (fugitive possibly) to merge my conflicts, but I hate the automerged conflict markers. I'm looking for something like



|-------------------------------|
| | | |
| LOCAL | HEAD | REMOTE |
| | | |
|-------------------------------|
| |
| clean head to merge |
| changes into |
|-------------------------------|


How do I set this up?










share|improve this question






















  • Does this link help? Or this one?
    – romainl
    Mar 1 '13 at 7:49














1












1








1


1





I want to use vim (fugitive possibly) to merge my conflicts, but I hate the automerged conflict markers. I'm looking for something like



|-------------------------------|
| | | |
| LOCAL | HEAD | REMOTE |
| | | |
|-------------------------------|
| |
| clean head to merge |
| changes into |
|-------------------------------|


How do I set this up?










share|improve this question













I want to use vim (fugitive possibly) to merge my conflicts, but I hate the automerged conflict markers. I'm looking for something like



|-------------------------------|
| | | |
| LOCAL | HEAD | REMOTE |
| | | |
|-------------------------------|
| |
| clean head to merge |
| changes into |
|-------------------------------|


How do I set this up?







vim git merge






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 1 '13 at 7:04









yarbelk

1063




1063












  • Does this link help? Or this one?
    – romainl
    Mar 1 '13 at 7:49


















  • Does this link help? Or this one?
    – romainl
    Mar 1 '13 at 7:49
















Does this link help? Or this one?
– romainl
Mar 1 '13 at 7:49




Does this link help? Or this one?
– romainl
Mar 1 '13 at 7:49










2 Answers
2






active

oldest

votes


















1














To always turn off conflict markers, you can configure the binary merge algorithm (source):



$ git config merge.default binary


Alternatively, the index has all different versions; just override your working copy with what you want:



$ git checkout --ours <filename>
$ git checkout --theirs <filename>
$ git checkout-index -f --stage=1 <filename> # for the base


(With Fugitive you can do this directly from within Vim.)






share|improve this answer































    0














    I use Fugitive. The amazing vim cast on resolving merge conflicts with vimdiff + Fugitive is what I use repeatedly every time I forget how to do this.




    1. You open up a conflicted file and type :Gvdiff (this gives you a vertical split as you want)

    2. You use :diffput (or just dp) to push code from local/remote windows to HEAD

    3. Once you're happy with the changes type :Gwrite and it will close the diff window and add the file to the Git index ready for the commit






    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      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%2fsuperuser.com%2fquestions%2f559164%2fmerging-git-with-vim-without-the-automerged-merged%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      To always turn off conflict markers, you can configure the binary merge algorithm (source):



      $ git config merge.default binary


      Alternatively, the index has all different versions; just override your working copy with what you want:



      $ git checkout --ours <filename>
      $ git checkout --theirs <filename>
      $ git checkout-index -f --stage=1 <filename> # for the base


      (With Fugitive you can do this directly from within Vim.)






      share|improve this answer




























        1














        To always turn off conflict markers, you can configure the binary merge algorithm (source):



        $ git config merge.default binary


        Alternatively, the index has all different versions; just override your working copy with what you want:



        $ git checkout --ours <filename>
        $ git checkout --theirs <filename>
        $ git checkout-index -f --stage=1 <filename> # for the base


        (With Fugitive you can do this directly from within Vim.)






        share|improve this answer


























          1












          1








          1






          To always turn off conflict markers, you can configure the binary merge algorithm (source):



          $ git config merge.default binary


          Alternatively, the index has all different versions; just override your working copy with what you want:



          $ git checkout --ours <filename>
          $ git checkout --theirs <filename>
          $ git checkout-index -f --stage=1 <filename> # for the base


          (With Fugitive you can do this directly from within Vim.)






          share|improve this answer














          To always turn off conflict markers, you can configure the binary merge algorithm (source):



          $ git config merge.default binary


          Alternatively, the index has all different versions; just override your working copy with what you want:



          $ git checkout --ours <filename>
          $ git checkout --theirs <filename>
          $ git checkout-index -f --stage=1 <filename> # for the base


          (With Fugitive you can do this directly from within Vim.)







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 1 '13 at 9:08

























          answered Mar 1 '13 at 8:55









          Ingo Karkat

          17.3k22343




          17.3k22343

























              0














              I use Fugitive. The amazing vim cast on resolving merge conflicts with vimdiff + Fugitive is what I use repeatedly every time I forget how to do this.




              1. You open up a conflicted file and type :Gvdiff (this gives you a vertical split as you want)

              2. You use :diffput (or just dp) to push code from local/remote windows to HEAD

              3. Once you're happy with the changes type :Gwrite and it will close the diff window and add the file to the Git index ready for the commit






              share|improve this answer


























                0














                I use Fugitive. The amazing vim cast on resolving merge conflicts with vimdiff + Fugitive is what I use repeatedly every time I forget how to do this.




                1. You open up a conflicted file and type :Gvdiff (this gives you a vertical split as you want)

                2. You use :diffput (or just dp) to push code from local/remote windows to HEAD

                3. Once you're happy with the changes type :Gwrite and it will close the diff window and add the file to the Git index ready for the commit






                share|improve this answer
























                  0












                  0








                  0






                  I use Fugitive. The amazing vim cast on resolving merge conflicts with vimdiff + Fugitive is what I use repeatedly every time I forget how to do this.




                  1. You open up a conflicted file and type :Gvdiff (this gives you a vertical split as you want)

                  2. You use :diffput (or just dp) to push code from local/remote windows to HEAD

                  3. Once you're happy with the changes type :Gwrite and it will close the diff window and add the file to the Git index ready for the commit






                  share|improve this answer












                  I use Fugitive. The amazing vim cast on resolving merge conflicts with vimdiff + Fugitive is what I use repeatedly every time I forget how to do this.




                  1. You open up a conflicted file and type :Gvdiff (this gives you a vertical split as you want)

                  2. You use :diffput (or just dp) to push code from local/remote windows to HEAD

                  3. Once you're happy with the changes type :Gwrite and it will close the diff window and add the file to the Git index ready for the commit







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 20 '18 at 20:59









                  icc97

                  339312




                  339312






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • 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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2fsuperuser.com%2fquestions%2f559164%2fmerging-git-with-vim-without-the-automerged-merged%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







                      Popular posts from this blog

                      Mouse cursor on multiple screens with different PPI

                      Agildo Ribeiro

                      Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”