'Git folder to google colab

I want to download a folder from github (not the entire repo!) into google colab.

How can I do this using a google colab cell execution?

For files I achieve this doing the following:

if 'google.colab' in str(get_ipython()):
  !wget https://raw.githubusercontent.com/fredzett/rmqa/master/utils.py -P local_modules -nc

I found the following link. Problem: this gives me the entire folder structure from my repo all the way down to the folder in my repo. I really just want the folder.

So e.g. I have a folder "datasets" in my github repo and it should show up as a folder "datasets" in google colab.

Is this possible?

Thanks!



Solution 1:[1]

Try this

!npx degit fredzett/rmqa/data data

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1