Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save irosyadi/9a21bd501afd60a7b541c2c23677f3f9 to your computer and use it in GitHub Desktop.

Select an option

Save irosyadi/9a21bd501afd60a7b541c2c23677f3f9 to your computer and use it in GitHub Desktop.
Clone a github repo into google drive using google colab

Here's how to import a github repo into drive using google colab.

In the first cell, import the drive package and mount you google drive:

from google.colab import drive
drive.mount('/content/drive')

In the next cell, put a bash script that just clones whatever repo you want:

%cd /content/gdrive/MyDrive/
%mkdir -p github-folder
%cd ./github-folder
!pwd
%git clone https://github.com/user/repo.git /content/gdrive/MyDrive/github-folder/
%cd ./drive/MyDrive/github-folder/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment