You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using GitPython to commit and push some changes in my Python application. However, sometimes my developers and I want to force push the commit (git push --force) instead of sometimes the app failing because it's behind the HEAD of the repository.
Is there an option you can pass into the git.push() method? I haven't seen it documented anywhere and I figured I might as well ask.
Thanks.
The text was updated successfully, but these errors were encountered:
g12mcgov
changed the title
Is there a way to force a git push command?
Is there a way to force a git push?
Aug 5, 2015
Great to hear that intuition led to the solution !
Indeed, the arguments to the <repo>.git.* methods are not documented in the tutorial, and I couldn't easily find explicit documentation about it elsewhere either. Users would certainly benefit from an update, and maybe you will feel like contributing to the documentation at some point - PRs are always welcome.
In short, this is how python arguments are translated to the command-line:
m=True -> -m
m="foo" -> -mfoo
message="foo" -> --message "foo"
-somethingveryspecial -> -somethingveryspecial
With non-keyword-arguments, the order is kept as is
Hi guys,
I'm using GitPython to commit and push some changes in my Python application. However, sometimes my developers and I want to force push the commit (
git push --force
) instead of sometimes the app failing because it's behind the HEAD of the repository.Is there an option you can pass into the
git.push()
method? I haven't seen it documented anywhere and I figured I might as well ask.Thanks.
The text was updated successfully, but these errors were encountered: