Closed iay closed 11 months ago
You are welcome :smile: I would make this configurable so that you can enable the force push if needed.
It would be fine (for me) if this was a configuration option, and probably safer (for you) if that code is used by something other than the GitHub destination.
I added the option to force push in force_push
Can you test it? There's just a new parameter called force for the GitHub
destination.
I should be able to test in an hour or so; I need to generate a failure first, of course, as my previous case is fixed :)
I can confirm that setting destination.github.force
to true
in a version built from that branch does what I want: rebasing or commit --amend
ing a development branch doesn't prevent pushes to GitHub; mirroring includes the manipulated branch and everything appears to be mirrored across correctly.
thanks a lot. I'll merge it then and create a new release.
just released v0.10.20 with this feature
Confirming the image of 0.10.20 works for me. Thanks again.
My current use case involves mirroring existing development repositories to private repositories in a GitHub organization: we're considering moving to GitHub at some point, and we'd want to overlap for a while.
I had already done some mirroring manually a couple of years back, and in most case Gickup has been able to update the previously created repositories on GitHub. One exception is a repository in which a development topic branch has since been rebased; this results in a
ERR non-fast-forward update
failure in Gickup.I know you've had discussions about forced pull (https://github.com/cooperspencer/gickup/discussions/144) but the way Gickup handles the GitHub destination in particular means this is an independent issue. Because Gickup always creates a new temporary local repository in this case, there's never a question of force-fetching, only force-pushing.
As an experiment, I added
Force: true
to the two calls togit.PushOptions
in lines 497 and 501 oflocal.go
:This seems to make the error message go away. I phrase it like that because this is literally the first time I've changed a line of Go code (thanks for the way I can just
docker build
to do this, by the way) and I have less than no idea what I'm doing. Seems plausible, though?