Python pygit2:如何;git远程设置分支源远程“U分支”名称;
标题说明了一切。我正在使用Python pygit2:如何;git远程设置分支源远程“U分支”名称;,python,git,pygit2,Python,Git,Pygit2,标题说明了一切。我正在使用pygit2,并试图找出如何实现使用git cli可以实现的以下目标: git remote set branchs origin remote\u branch\u name如果直接设置可能更简单(因为没有明显的方法设置获取URL) 使用: repo_obj = pygit2.Repository(repopath) repo_obj.config.set_multivar( 'remote.origin.fetch', '',
pygit2
,并试图找出如何实现使用git cli可以实现的以下目标:
git remote set branchs origin remote\u branch\u name
如果直接设置可能更简单(因为没有明显的方法设置获取URL)使用:
repo_obj = pygit2.Repository(repopath)
repo_obj.config.set_multivar(
'remote.origin.fetch',
'',
'+refs/heads/remote_branch_name:refs/remotes/myOrigin/remote_branch_name'
)