Created
March 22, 2018 19:30
-
-
Save MathyV/80d2507f6843e391211f2ec5e0effa3c to your computer and use it in GitHub Desktop.
Force push with pygit2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I had a need to force update and push the master branch | |
# Took me a while to find this so I thought I'd share | |
# Just add a + in front of the branch name and it will work | |
branch = "refs/heads/master" | |
repo.create_reference(branch, "refs/heads/develop", force=True) | |
repo.remotes['origin'].push(['+' + branch], callbacks=callbacks); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok, got it. Thank you.