Giter Site home page Giter Site logo

colab-github's Introduction

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.
!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, or your repo's Deploy Keys.

  • Use SSH method to clone your private repo. Inside the notebook, you can run
!git clone git@github.com:<your_username>/<your_private_repo>.git

colab-github's People

Contributors

tsunrise avatar davies-w avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.