A typical workflow with Git branching
A distributed version control system such as Git is designed for complex and nonlinear workflows typical in interactive computing and exploratory research. A central concept is branching, which we will discuss in this recipe.
Getting ready
You need to work in a local Git repository for this recipe (see the previous recipe, Learning the basics of the distributed version control system Git).
How to do it…
- We create a new branch named
newidea
:$ git branch newidea
- We switch to this branch:
$ git checkout newidea
- We make changes to the code, for instance, by creating a new file:
$ touch newfile.py
- We add this file and commit our changes:
$ git add newfile.py $ git commit -m "Testing new idea."
- If we are happy with ...
Get IPython Interactive Computing and Visualization Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.