我通常使用它在 colab 中克隆 github 存储库
!git 克隆 https://github.com/user/repo.git
但假设我想克隆存储库的特定分支。我试过了
!git 克隆 https://github.com/user/repo/tree/branch.git
但我收到错误
致命:存储库'https://github.com/user/repo/tree/branch.git/ ' 未找到
最佳答案
试试这个:
!git clone -b branch_name https://github.com/user/repo.git
将branch_name替换为您要克隆的分支的名称
关于python - 如何克隆Python、Colab中的特定分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57130210/