2013-05-15 17 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)