go-git
go-git copied to clipboard
Force option in push request?
In options.go file there is the option to force for pull and fetch requests? Is there any reason why it is not implemented with push or just because it's a feature to develop?
I just saw this as well, here is what I found to work:
err = g.Push(&git.PushOptions{
RemoteName: GIT_REMOTE_NAME,
RefSpecs: []gitconf.RefSpec{"+refs/heads/master:refs/heads/master"},
})
if err != nil {
panic(err)
}
This commit from 2017 gave me the hint: 38bd9e82fd3d83fd9a82678ec89227aeda2c3b78
Thank you @pojntfx it seems it works. Nevertheless, I reckon that a force option should be implemented anyway.