有什么推荐的方法来集成git和colab吗?
例如,是否可以从google源代码库或类似库中提取代码?
google drive和云存储都不能用于git功能。
所以我想知道是否还有一种方法可以做到这一点?
发布于 2018-07-20 19:55:48
如果您想克隆私有存储库,最快的方法是创建一个personal access token,并只选择您的应用程序需要的特权。然后,GitHub的克隆命令将如下所示:
!git clone https://git_token@github.com/username/repository.git
发布于 2018-01-22 03:03:42
计算机上安装了git
,您可以使用!
调用shell命令。
例如,要克隆git
存储库:
!git clone https://github.com/fastai/courses.git
下面是一个完整的示例,它克隆一个存储库并加载其中存储的Excel文件。https://colab.research.google.com/notebook#fileId=1v-yZk-W4YXOxLTLi7bekDw2ZWZXWW216
发布于 2019-08-18 03:07:35
在Google colab中克隆您的私有github存储库的简单方法如下所示。
import os
from getpass import getpass
import urllib
user = input('User name: ')
password = getpass('Password: ')
password = urllib.parse.quote(password) # your password is converted into url format
repo_name = input('Repo name: ')
cmd_string = 'git clone https://{0}:{1}@github.com/{0}/{2}.git'.format(user, password, repo_name)
os.system(cmd_string)
cmd_string, password = "", "" # removing the password from the variable
https://stackoverflow.com/questions/48350226
复制相似问题