How to clone from specific branch from Git using Gitpython

前端 未结 2 1988
温柔的废话
温柔的废话 2021-01-05 19:06

I tried to clone a repository from git using GitPython in python function. I used GitPython library for cloning from git in my python function and my code snippet as follows

2条回答
  •  情书的邮戳
    2021-01-05 19:29

    From toanant's answer.

    This works for me with the --single-branch option

    repo = Repo.clone_from( 'http://user:password@github.com/user/project.git --single-branch', '/home/antro/Project/', branch='master' )

提交回复
热议问题