Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python pygit2:如何;git远程设置分支源远程“U分支”名称;_Python_Git_Pygit2 - Fatal编程技术网

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'
    )