'Git-lfs: Not in a git repository error when downloading cBioPortal files onto Google Colab

I want to download the gbm_tcga_pub2013 dataset from cBioPortal (https://www.cbioportal.org/study/summary?id=gbm_tcga_pub2013) using git-lfs onto Google Colab. I receive a Not in a git repository. error

!curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
!sudo apt-get install git-lfs
!git lfs install --skip-repo --skip-smudge
!git clone https://github.com/cBioPortal/datahub.git
!cd datahub
!git lfs install --local --skip-smudge
!git lfs pull -I public/gbm_tcga_pub2013

Traceback:

Not in a git repository.
Not in a git repository.

Even though I was able to change directory to /datahub, my working directory as per pwd is still root.



Solution 1:[1]

Try changing from !cd datahub to

%cd datahub 

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 korakot