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 and merging branches

Separate branches are often used to create separate chunks of work. Once the feature is ready, the branches are merged back into the master (primary) branch. To create a new branch, run the following:

$ git checkout -b <branch-name>

For instance, we could create a branch in which we add a new animal type:

$ git checkout -b feature-leopard

It will appear as the following:

Now, you can perform work on this branch as usual. For instance, we could add a new animals/leopard.py and modify animal_farm.py just like we did in the previous section:

Now that our feature is ready (we've added the leopard), we're ready ...

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