I need a GitPython equivalent command or commands of this git clone -b <branch_name> --recursive <url>
. I hope the subprocess call is not the only way to do this. If anybody have an idea please let me know.
Asked
Active
Viewed 254 times
2 Answers
1
clone(path, progress=None, **kwargs)
accepts kwargs
which are passed on to the call of git clone
:
- odbt = ObjectDatabase Type, allowing to determine the object database implementation used by the returned Repo instance
- All remaining keyword arguments are given to the git-clone command
So you just add the options to your call to clone
:
repo.clone(path, b=branch_name, recursive=url)

tynn
- 38,113
- 8
- 108
- 143
-
GitPython uses itself subprocess calls : https://github.com/gitpython-developers/GitPython/blob/master/git/cmd.py#L17 – edi9999 Aug 03 '15 at 10:06
-1
Git it self doesn't provide you with bindings for any programming languages (not even C). Libgit is one implementation of git as a library to be used in C. They are bindings to that library for many languages (see Which language has the best Git API Bindings?).
PyGit seems to be one that is maintained and works on git
-
[GitPython](https://github.com/gitpython-developers/GitPython) (which is what the OP is asking about) is a Python module for interacting with Git repositories. – larsks Jul 31 '15 at 14:57