merging git with vim without the automerged MERGED
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
add a comment |
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
Does this link help? Or this one?
– romainl
Mar 1 '13 at 7:49
add a comment |
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
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
vim git merge
asked Mar 1 '13 at 7:04
yarbelk
1063
1063
Does this link help? Or this one?
– romainl
Mar 1 '13 at 7:49
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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.)
add a comment |
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.
- You open up a conflicted file and type
:Gvdiff(this gives you a vertical split as you want) - You use
:diffput(or justdp) to push code from local/remote windows to HEAD - Once you're happy with the changes type
:Gwriteand it will close the diff window and add the file to the Git index ready for the commit
add a comment |
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
});
}
});
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%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
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.)
add a comment |
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.)
add a comment |
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.)
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.)
edited Mar 1 '13 at 9:08
answered Mar 1 '13 at 8:55
Ingo Karkat
17.3k22343
17.3k22343
add a comment |
add a comment |
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.
- You open up a conflicted file and type
:Gvdiff(this gives you a vertical split as you want) - You use
:diffput(or justdp) to push code from local/remote windows to HEAD - Once you're happy with the changes type
:Gwriteand it will close the diff window and add the file to the Git index ready for the commit
add a comment |
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.
- You open up a conflicted file and type
:Gvdiff(this gives you a vertical split as you want) - You use
:diffput(or justdp) to push code from local/remote windows to HEAD - Once you're happy with the changes type
:Gwriteand it will close the diff window and add the file to the Git index ready for the commit
add a comment |
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.
- You open up a conflicted file and type
:Gvdiff(this gives you a vertical split as you want) - You use
:diffput(or justdp) to push code from local/remote windows to HEAD - Once you're happy with the changes type
:Gwriteand it will close the diff window and add the file to the Git index ready for the commit
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.
- You open up a conflicted file and type
:Gvdiff(this gives you a vertical split as you want) - You use
:diffput(or justdp) to push code from local/remote windows to HEAD - Once you're happy with the changes type
:Gwriteand it will close the diff window and add the file to the Git index ready for the commit
answered Dec 20 '18 at 20:59
icc97
339312
339312
add a comment |
add a comment |
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.
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%2fsuperuser.com%2fquestions%2f559164%2fmerging-git-with-vim-without-the-automerged-merged%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
Does this link help? Or this one?
– romainl
Mar 1 '13 at 7:49