Search code examples
gitgoogle-colaboratorygit-clone

How do I link a GitHub repository to a Google Colab notebook?


I have created a GitHub repository and I want to link it to my Colab notebook, but I am unable to do that. I have used the following command to get a clone of git repo:

! git clone link/to/your/repo

But I get this error:

fatal: repository 'link/to/your/repo' does not exist

Can someone please point out my mistake? Thanks!


Solution

  • When you use in Colab website:

    You can simply go to Google Colab and you can choose 'GitHub' on the box which you can see when you just go to the Colab site and login. Colab will automatically redirect you to github in order to authorize your github account. Then you can choose repository to use at Google Colab!

    When you use in local CLI:

    You need to check out the URL that you provided in command. It MUST BE a valid git(hub) url.