![]() Buffer numbers are assigned sequentially, so they will differ from session to session, but you can always be sure that they will uniquely identify their buffer.įugitive follows a consistent naming convention when creating buffers for the target and merge versions of a conflicted file. The buffspec could either be the buffer number, or a partial match for the buffer’s name. You have to specify which buffer to fetch the changes from by providing a. This time, it would be ambiguous if you were to tell Vim to fetch the changes from the other window. When you do a 3-way merge, things get a little more complex. If you ask Vim to get the diff from the other window, there is only one place for it to look. ![]() In the context of a 2-way diff, the :diffget and :diffput commands are unambiguous. We’ll take a look at each of these strategies in turn, starting with diffget. Or you can position your cursor on the change that you want to keep, and run :diffput with the bufspec for the working copy file. You can either keep your cursor in the middle file, and run :diffget with the bufspec for the file containing the change you want to keep. There are two basic strategies for reconciling a 3-way diff. In this scenario the ‘master’ branch is the target, and the ‘feature’ branch is merged into target, making it the merge branch. The ‘merge’ branch is the one that is named in the git merge command. The ‘target’ branch is the one that is active when you run git merge. I discuss target and merge branches a lot in the screencast, so lets just make sure that we’re on the same page. the right window contains the version from the merge branch.the middle window contains the working copy of the file, complete with conflict markers.the left window contains the version from the target branch. ![]() ![]() When you run :Gdiff on a conflicted file, fugitive opens 3 split windows. :Gdiff on a conflicted file opens 3-way diff ![]()
0 Comments
Leave a Reply. |