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
just pass the branch name parameter, e.g. :-
repo = Repo.clone_from( 'http://user:password@github.com/user/project.git', '/home/antro/Project/', branch='master' )
see here for more info