如何使用德威公司从遥控器拉出? [英] How to pull from the remote using dulwich?

查看:117
本文介绍了如何使用德威公司从遥控器拉出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在python dulwich库中执行类似于 git pull 的操作。

解决方案

我还没有使用德威,但从这些文档的,可能类似于:

  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]

此时,它并未加载文件,但我可以从本地路径执行git checkout,并更新了文件。



此外,看到这些:


How to do something like git pull in python dulwich library.

解决方案

I haven't used dulwich, but from these doc's, possibly something like:

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"]

At this point, it didn't load the files, but I could do "git checkout" from the local path, and it updated the files.

Also, saw these:

这篇关于如何使用德威公司从遥控器拉出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆