This is an example Notebook to show how gitInformation works.
In [1]:
# Import the gitInformartion file to your notebook
# It's important that you have installed GitPython (pip install gitpython) and that you have a local Git repository
import sys
sys.path.insert(0, 'C:\Users\Dominik\Documents\GitRep\ipython-notebook-git')
import gitInformation
In [2]:
#If your notebook is located in a git repository, you are now able to plot some informations about the notebook to verify the version.
gitInformation.printInformation()
As you can see, the 'printInformation' function collects all information by its own, so you dont need to set any path.
In [3]:
# You're also able to set the path by your own to get the git information
gitInformation.printInformation('C:\Users\Dominik\Documents\GitRep\ipython-notebook-git\example notebook')
In [4]:
# It is also possible to print single information like the current branch, Git commit sha, remote and directory
gitInformation.printCurrentBranch()
In [5]:
gitInformation.printCurrentGitSHA()
In [6]:
gitInformation.printCurrentRemote()
In [7]:
gitInformation.printGitDirectory()