-
-
Notifications
You must be signed in to change notification settings - Fork 933
Shallow clone? #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could it be that your installed git version is too old and doesn't support the 'depth' flag ? What happens if you execute |
I am able to shallow clone in terminal. What would you say is the correct syntax to shallow clone using GitPython's clone method? (just so we are clear) Thanks! |
The syntax I used is the correct one, which is the same that git-python uses.
When interpreting the error What does your git-python code look like ? |
Thanks for looking into this. I will try to explain whats happening on my side.
Where clone_url is a string "https://github.com/scrollback/argent.git" How can I fix this? |
If you want to use git directly, you have to pass each argument individually. The call you want would be git.Git().clone(clone_url, to_directory, depth=1) Besides, I'd recommend not to use the git command directly unless you have to. A more pythonic way to achieve the same would be this: repo = git.Repo.clone_from(clone_url, to_directory, depth=1)
Also I't be grateful if you would prefer to ask questions on Stackoverflow instead, just use the Thanks |
Oh! I wasn't aware that additional arguments are to be passed with clone method itself. Thanks for clearing this up! Noted about using Repo class and stackoverflow. Thanks so much! 👍 |
@Byron sorry to drag up an old thread, but where is the |
@zhimsel Could it be one of the kwargs which are automatically passed down as arguments to the git command-line? |
@Byron ah, you know what, you're probably right. I must have not notice that part where all |
hi!
I am using GitPython for a personal project and I want to clone repositories on behalf of user but this takes very long time if repos are huge. I am unable to shallow clone because the -- chars are removed when I run the clone method.
GitCommandError: 'git clone --depth 1 https://github.com/scrollback/argent.git' returned with exit code 129
stderr: 'error: unknown option `depth 1 https://github.com/scrollback/argent.git'
What is a workaround for this?
Thanks!
The text was updated successfully, but these errors were encountered: