I want to clone a github project in Google Colab and work on some notebooks of the project. The notebook usually assume that they run in the folder corresponding to the content of the project. So, wrapping the project in another name (the project name) may mess the import
section.
Anyways, it's what I tried:
!rm -r sample_data/
!git clone https://github.com/n-waves/multifit.git .
However it raise the following error:
fatal: destination path '.' already exists and is not an empty directory.
However, I see nothing in the content
folder (the working directory of colab). So, I don't know how to solve this problem.
Update: apparently there is a .config
directory there, which is hidden. I removed the config directory via !rm -r .config/
and now the clone was performed. However, it's not a nice solution because the config folder might be needed by the Google.
I also tried a similar question by How do I clone into a non-empty directory?
!git init
!git remote add origin https://github.com/n-waves/multifit.git
!git fetch
!git reset origin/master # Required when the versioned files existed in path before "git init" of this repo.
!git checkout -t origin/master
But it gives the error:
fatal: A branch named 'master' already exists.