Access Git folder information from notebook

johnb1
Contributor

In my Workspace, I have a repository with Git folder.

I would like to access programatically with Python from within a notebook:

- name of the repo

- currently checked out branch in the repo

I want to do this in two different ways:

(1) Access said information in a notebook inside the repo's working directory

(2) Access said information in a notebook outside the repo's working directory

Can I achieve both aims, and how?

szymon_dybczak
Esteemed Contributor III

Hi @johnb1 ,

You can use one of the following options to achieve what you want: 

- databricks CLI repos commands 

- databricks python SDK

- databricks rest API calls