git - 如何在 Google Colab 中的 GitHub 分支之间切换
问题描述
我已经在 Google Colab 中克隆了一个 GitHub 存储库,!git clone ...
但现在我想切换到我一直在研究的另一个分支。似乎 GitHub 没有为不同的分支提供唯一的克隆链接,而 colab 不允许使用!git checkout ...
命令。有什么办法可以更改 colab 中的分支吗?
解决方案
是的,例如:
!git clone https://github.com/googlecolab/colabtools.git
!cd colabtools && git checkout incoming
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'
推荐阅读
- firebase - 使用本机反应,firebase 查询不会使用正常功能返回,如何解决?
- javascript - 在 Discord.js 中更改昵称时遇到问题,给我 DiscordAPIError: Missing Permissions
- vim - 如何使用 vim 普通模式复制所有行
- tableau-api - 在centos 7 上安装tableau server 出现错误
- javascript - @firebase/firestore:Firestore (8.6.5):无法访问 Cloud Firestore 后端
- javascript - 无法将副本导入为邮递员
- android - 我如何从 Api 下载数据
- python - 查找附近没有素数的数字
- windows - 是否有与 rsync -b 等效的 robocopy 选项(备份已删除文件)
- assembly - 在 Visual Studio 中无法使此组装过程正常工作