Dulwich ~ push to a certain branch
- change a file
- push to a certain branch (not master)
I read the documentation and also this post on SO, but I don’t get it. Can someone explain how to chose a specific branch to push to?
One Solution collect form web for “Dulwich ~ push to a certain branch”
During the push phase, you can specify how you would like to update the refs in the remote repository.
from dulwich.client import get_transport_and_path from dulwich.repo import Repo repo = Repo(".") client, path = get_transport_and_path("git+ssh://firstname.lastname@example.org/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)