cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Download private repo from GitHub Enterprise in Databricks notebook

User16753724663
Valued Contributor

We are trying to download our repository which is hosted on GitHub Enterprise to use its python libraries in our notebooks.

Earlier we had issues with downloading our repository using the repos feature in Databricks platform since only notebooks can be version controlled using repos tab.

we use “%sh git clone” inside the notebook for our use case. But we faced some issues on that workaround as well.

Steps tried:

1. Created personal access token in my github account with almost all options enabled.

2. Added that personal access token to my user settings in our Databricks deployment. Following instructions from this link:

https://docs.databricks.com/notebooks/github-version-control.html

3. Created a notebook in a cluster and executed the below command and got this error.

Cmd: %sh git clone https://github.com/repo/repo.git

Error: Cloning into 'repo'...

fatal: could not read Username for 'https://github.com': No such device or address

I believe the cluster is not able to fetch my username, I am not sure on how to add it or the recommended way to do it (either by git config or may be how to give this information in the git URL itself).

1 REPLY 1

User16753724663
Valued Contributor

To fix the issue, we need to pass the token in the header itself

git clone https://<token>:x-oauth-basic@github.com/owner/repo.git

Example:

%sh
 
git clone https://<token>@github.com/darshanbargal4747/databricks.git

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group