In Dulwich, how do I commit to a branch instead of to HEAD?

十年热恋 提交于 2019-12-06 05:07:44

问题


Apparently repo.do_commit(message='test commit', committer='Name ') only commits to refs/heads/master.

Is there a way to set the current commit ref to another one than refs/heads/master?

Or is the only way to commit to a branch by creating a Commit object (as shown in the tutorial in the documentation) and setting it's parent to be the one of the branches commit id?

Should this be true, which would then be the use of repo.do_commit other than committing to refs/heads/master?


回答1:


Creating a Commit object manually and then setting the tag is indeed the only way to commit to a non-HEAD branch in the last release.

do_commit() in trunk supports a "ref" argument that you can use to commit to other branches.

http://www.samba.org/~jelmer/dulwich/apidocs/dulwich.repo.BaseRepo.html#do_commit



来源:https://stackoverflow.com/questions/6904734/in-dulwich-how-do-i-commit-to-a-branch-instead-of-to-head

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!