Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Data Science by (17.6k points)

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

1 Answer

0 votes
by (41.4k points)

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.

Related questions

0 votes
1 answer
+1 vote
1 answer
+7 votes
1 answer
asked Jul 29, 2019 in DevOps and Agile by Han Zhyang (19.7k points)

Browse Categories

...