我没有使用过德威,但是从这些文档来看,可能是这样的:
from dulwich.repo import Repo
from dulwich.client import HttpGitClient
local = Repo.init("local", mkdir=True)
client = HttpGitClient('http://github.com/adammorris/')
remote_refs = client.fetch("history.js.git",local)
local["HEAD"] = remote_refs["refs/heads/master"]
Run Code Online (Sandbox Code Playgroud)
此时,它没有加载文件,但我可以从本地路径执行"git checkout",并更新文件.
另外,看到这些:
| 归档时间: |
|
| 查看次数: |
1680 次 |
| 最近记录: |