Back
I usually use this to clone a github repo in colab
!git clone https://github.com/user/repo.git
But say I want to clone a specific branch of the repo. I tried
!git clone https://github.com/user/repo/tree/branch.git
But I get an error
fatal: repository 'https://github.com/user/repo/tree/branch.git/' not found
Use this:
!git clone -b branch_name https://github.com/user/repo.git
In place of branch_name, put the name of the branch that you want to clone.
If you wish to know about Python visit this Python Course.
31k questions
32.8k answers
501 comments
693 users