![diffmerge git tutorial diffmerge git tutorial](https://coedl.github.io/yinarlingi/articles/figures/git-wf_step-2/lex_change-3.png)
Now if your terminal has any GUI capability and you have compiled Vim correctly with GUI support, you can use your mouse to click on the bottom split to edit it. You can find this info in the bottom bar of each split (I have put 3 yellow rectangles to highlight that info).Īs you can see form the below image, my Vim has highlighted the differences in red for me. The bottom split refers to the MERGED version. The top left split panel is the LOCAL, top middle split is BASE and top right split is REMOTE. Then it will bring up the different versions of the file in different Vim splits panels. We can bring up the mergetool: $ git mergetool Then you will see some error messages: Auto-merging astrophy_obj.txtĬONFLICT (content): Merge conflict in astrophy_obj.txtĪutomatic merge failed fix conflicts and then commit the result. # merge from the astrophy_objects branch to current branch, i.e. $ git commit -am 'added galaxy to each line' # type `:%s/$/ galaxy/g` in Vim then press enter and save `:wq` # add the word `galaxy` to the end of each line using Vim REGEX $ git checkout master # change back to master branch $ vim astrophy_obj.txt # make changes to fileĬhange bar to barred in the file. $ git checkout astrophy_objects # change to new branch $ git branch astrophy_objects # create a new branch
![diffmerge git tutorial diffmerge git tutorial](https://coedl.github.io/yinarlingi/articles/figures/git-wf_step-2/save_changes-2.png)
We have to change the git config to set a default mergetool.Īdd some galaxy types into astrophy_obj.txt then save the file. Setting up different editors / tool for using git mergetool It will help your understanding of Git tremendously. Please read this tutorial explaining the HEAD objects if you do not know what it is. MERGED - the tag / HEAD object after the merge - this is saved as a new commit.Ĭommon mergetool from editors will display both LOCAL and REMOTE so you can decide which changes to keep.BASE - the common ancestor(s) of LOCAL and REMOTE.REMOTE - the head for files(s) from a remote location that you are trying to merge into your LOCAL branch.LOCAL - the head for the file(s) from the current branch on the machine that you are using.
DIFFMERGE GIT TUTORIAL CODE
![diffmerge git tutorial diffmerge git tutorial](https://www.poftut.com/wp-content/uploads/2017/02/img_58b3b8f11da51-300x160.png)
2-min tutorial to do it the quick-and-dirty-way.