Book Image

IPython Interactive Computing and Visualization Cookbook

By : Cyrille Rossant
Book Image

IPython Interactive Computing and Visualization Cookbook

By: Cyrille Rossant

Overview of this book

Table of Contents (22 chapters)
IPython Interactive Computing and Visualization Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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…

  1. We create a new branch named newidea:

    $ git branch newidea
    
  2. We switch to this branch:

    $ git checkout newidea
    
  3. We make changes to the code, for instance, by creating a new file:

    $ touch newfile.py
    
  4. We add this file and commit our changes:

    $ git add newfile.py
    $ git commit -m "Testing new idea."
    
  5. If we are happy with the changes, we merge the branch to the master branch (the default):

    $ git checkout master
    $ git merge newidea
    

    Otherwise, we delete the branch:

    $ git checkout master
    $ git branch -d newidea
    

Other commands of interest include:

  • git status: Find the current...