Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/tsunrise/colab-github
- Owner: tsunrise
- License: mit
- Created: 2023-01-09T22:33:39.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-09T23:49:03.000Z (about 2 years ago)
- Last Synced: 2024-12-03T17:48:41.611Z (2 months ago)
- Topics: colab-notebook, git, github, google-colab
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 28
- Watchers: 1
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Access GitHub Private Repo in Google 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
```