1

When I have conflicts in the branches I use git mergetool which I configured to default for meld. However I keep have to close and open meld for each file. How can I configure git (1.9.1) or meld (1.8.4) to open just one meld instance for all the files in conflict?

$git mergetool
Merging:
DESCRIPTION
README.md

Normal merge conflict for 'DESCRIPTION':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (meld): 


Normal merge conflict for 'README.md':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (meld): 

Once I close the first merge conflict for DESCRIPTION I am prompted to open again meld. This can be circumvented by this solution (using git mergetool -y) close to what I would expect but still it closes a conflict to open the next one, I can't save and go to the next conflict (The option Changes>Next Conflict is in grey and I can't select it). However this improves avoiding going back to terminal to press "Enter" and back to meld. I would like to open just once meld.

Google hasn't helped me and neither the help page of meld. Maybe it is a problem with this tool to view the conflicts.

This question may lack information about the configuration I have, but I don't know what or how to retrieve it. So ask in comments if anything is needed.

Community
  • 1
  • 1
llrs
  • 3,308
  • 35
  • 68
  • I use Git from the command line for most things, but I use my IDE for resolving merge conflicts. Try resolving using a conflict tool in Eclipse, IntelliJ, or NetBeans and you will see what you have been missing. – Tim Biegeleisen May 02 '17 at 10:44
  • Checkout git tortoise, it's pretty decent little tool. I use it for merge conflicts. – Grinch91 May 02 '17 at 10:49
  • Thanks @Tim, I am not sure how Rstudio solve conflicts between git repositories and svn repositories. – llrs May 02 '17 at 11:10
  • I use Ubuntu and git tortoise if for windows @Grinch, I don't think git tortoise is the right tool for this problem – llrs May 02 '17 at 11:11
  • How did RStudio become part of your question? – Tim Biegeleisen May 02 '17 at 11:12
  • It is not, but as you propose an IDE, I say what IDE I am using – llrs May 02 '17 at 11:12
  • I will tell you that I often prefer _not_ to use a conflict resolution tool. The merge markers are very clear, and you would be surprised at how easy it is. This isn't a direct answer, just an alternative. – Tim Biegeleisen May 02 '17 at 11:19
  • As long as you kick off the merge tool from the command line, i.e. `git mergetool`, it's not possible, IIUC, because `git mergetool` relies on the termination of the tool itself to progress through the merge process. – jingx May 02 '17 at 15:00
  • Well, I suppose in theory you could write a wrapper script around meld to start it only once, and configure that script as a mergetool. But I imagine it'll get pretty complicated pretty quickly - the script itself must properly start, wait for however long the merging takes in meld, and end as git expects, so from meld you somehow need to let the script know that the merging is done. – jingx May 02 '17 at 15:07
  • Thanks @jingx, that might be an answer. But do you have some source to confirm it? I thought that if the -y option exists because it might be to let the mergetool deal with all the conflicts. – llrs May 02 '17 at 15:12

0 Answers0