Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tsunrise/colab-github

Authenticate with GitHub in Google Colab to access private repo.
https://github.com/tsunrise/colab-github

colab-notebook git github google-colab

Last synced: 6 days ago
JSON representation

Authenticate with GitHub in Google Colab to access private repo.

Awesome Lists containing this project

README

        

# Access GitHub Private Repo in Google Colab

Open In Colab

Authenticate with GitHub in Google Colab to access private repo.

## Steps
- Run the following code inside the colab notebook.
```python
!wget -q https://raw.githubusercontent.com/tsunrise/colab-github/main/colab_github.py
import colab_github
colab_github.github_auth(persistent_key=True)
```
Note that by setting `persistent_key` to true, you will be asked to connect to Google Drive, so this script will store private key inside your `.colab-github` folder of your Google Drive. Doing so, you only need to upload your private key to Github once.

- You will see outputs like:
```
Please go to https://github.com/settings/ssh/new to upload the following key:
ssh-ed25519 xxxxxxx/xxxxxxxxxxxxxxxxxxxx root@xxxxxxxxxxxxxxxx
```
Upload this public key to either your [SSH settings](https://github.com/settings/ssh/new), or your repo's Deploy Keys.

- Use **SSH** method to clone your private repo. Inside the notebook, you can run
```python
!git clone [email protected]:/.git
```