The procedure is as follows.
--Mount google drive
google_drive.py
from google.colab import drive
drive.mount('/content/drive')
--Create a repository in the location specified by git clone
git_clone.py
import shutil
import os
#Change the current directory
os.chdir('/content/drive/My Drive')
cur_dir = os.getcwd()
git_name = '/MongoDB_PyMongo_Tutorial'
git_folder = cur_dir + git_name
#Delete if it exists
if os.path.exists(git_folder):
shutil.rmtree(git_folder)
#Clone
!git clone https://github.com/Giffy/MongoDB_PyMongo_Tutorial.git
--Implementation result
Recommended Posts