class neptune.git_info.GitInfo(commit_id, message='', author_name='', author_email='', commit_date='', repository_dirty=True, active_branch='', remote_urls=None)[source]

Bases: object

Class that keeps information about a git repository in experiment.

When create_experiment() is invoked, instance of this class is created to store information about git repository. This information is later presented in the experiment details tab in the Neptune web application.

  • commit_id (str) – commit id sha.

  • message (str, optional, default is "") – commit message.

  • author_name (str, optional, default is "") – commit author username.

  • author_email (str, optional, default is "") – commit author email.

  • commit_date (datetime.datetime, optional, default is "") – commit datetime.

  • repository_dirty (bool, optional, default is True) – True, if the repository has uncommitted changes, False otherwise.


Retrieve information about git repository.

If attempt fails, None will be returned.


repo_path (str, optional, default is None) –

Path to the repository from which extract information about git.
If None is passed, calling get_git_info is equivalent to calling git.Repo(search_parent_directories=True). Check GitPython docs for more information.


GitInfo - An object representing information about git repository.


# Get git info from the current directory
git_info = get_git_info('.')