-
-
Notifications
You must be signed in to change notification settings - Fork 933
Cannot push branch upstream #1408
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
One weird thing: restarting my computer or reinstall |
Without knowing what caused the issue, I assume that it's resolved now. There can be a variety of issues with GitPython not being able to use ssh keys as these usually aren't authorized for use. The only way to control this is like so: ssh_cmd = 'ssh -i id_deployment_key'
with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):
git_repo.git.push("--set-upstream", "origin", "master") (the above is a modified sample from the GitPython tutorial). Even though I am closing this issue as there is nothing actionable right now, please feel free to keep commenting if there is anything else that might change that. |
I'm still getting the same error with the code you provided, and sometimes, reinstalling GitPython helps, but not always. Would you have any suggestions as to what I can do to try to debug this? |
Some more information:
new_tag = git_repo.create_tag(tag_name)
git_repo.remotes.origin.push(new_tag)
os.system("cd /my/git/repo && git push --set-upstream origin master") Maybe it's because of something I did before that is just braking it? |
@aurelien-m Just for completeness, does |
Thanks for coming back to me @Byron. Yes, I expect it to behave the same, and it does indeed behave identically. After a few tests, the following code: os.system("cd /my/git/repo && git push --set-upstream origin master") Returns the following error (not all the time, I'm not able to find what causes this issue):
So using I have finally added a simple |
Hello,
I have a strange issue that I have not been able to resolve... It seems to maybe come from my SSH key, but I don't have any issues with it (git in the terminal works fine).
Here's what my code looks like:
But at the last line, it breaks with this error:
Using
git push --set-upstream origin master
works fine in the terminal. What is going wrong here? Thanks!The text was updated successfully, but these errors were encountered: