Steps for pulling from remote using pygit2

夙愿已清 提交于 2019-12-06 16:46:15

The create_reference method changes the target in order for said target to contains (reference) the name.

Here, after a fetch, you would want to set the reference of the local branch (you want to checkout) to the right remote tracking branch (you just fetched):

repo.create_reference('refs/remotes/origin/master', 'refs/heads/master')

You can look up the file "refs/heads/master" in your .git folder: it is a simple file with the reference it has to contain in order for that branch to point to (reference) another branch SHA1.

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