如何在 Google Colab 中的 GitHub 分支之间切换

Tir*_*tel 2 git google-colaboratory

我已经在 Google Colab 中克隆了一个 GitHub 存储库!git clone ...,但现在我想切换到我一直在处理的另一个分支。似乎 GitHub 没有为不同分支提供唯一的克隆链接,并且 colab 不允许!git checkout ...命令。有什么办法可以改变colab中的分支吗?

jak*_*vdp 5

是的,例如:

!git clone https://github.com/googlecolab/colabtools.git
!cd colabtools && git checkout incoming
Run Code Online (Sandbox Code Playgroud)
Cloning into 'colabtools'...
remote: Enumerating objects: 125, done.
remote: Counting objects: 100% (125/125), done.
remote: Compressing objects: 100% (125/125), done.
remote: Total 1580 (delta 58), reused 67 (delta 0), pack-reused 1455
Receiving objects: 100% (1580/1580), 466.90 KiB | 861.00 KiB/s, done.
Resolving deltas: 100% (887/887), done.
Branch 'incoming' set up to track remote branch 'incoming' from 'origin'.
Switched to a new branch 'incoming'
Run Code Online (Sandbox Code Playgroud)