O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating merge conflict

Let's use the animal_farm/ repository we initialized earlier in this chapter as an example (or you can follow this with your own example if you have a merge conflict you're trying to resolve):

$ cd animal_farm/

We'll create an additional branch which will conflict with the master branch. In the animal-create branch, we'll rename a make_animal method to create-animal while, in the master branch, we'll change it to build_animal. The order of operations is important in creating the conflict, so you may want to follow closely.

We can start by creating a branch and editing animal_farm.py:

$ git checkout -b create-animal$ vim animal_farm.py

Let's replace our make_animal method with create_animal:

...def create_animal(kind): ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required