2013-05-15 18 views
1

我想这样做与现有的git回购dulwich如下:德威〜推到某个分支

  • 变化的文件
  • 提交
  • 推到一定的分支(未掌握)

我读过这篇文档,也是关于SO的这个post,但我不明白。有人可以解释如何选择一个特定的分支推动?

感谢

回答

1

在推阶段,您可以指定您希望如何在远程的存储库更新裁判。

E.g. (未经测试)::

from dulwich.client import get_transport_and_path 
from dulwich.repo import Repo 
repo = Repo(".") 
client, path = get_transport_and_path("git+ssh://[email protected]/jelmer/foo") 
def update_refs(refs): 
    refs["refs/heads/somebranch"] = repo["refs/heads/somebranch"] 
client.send_pack(path, update_refs, repo.object_store.generate_pack_contents)