Missing push options --all --mirror #1054
Replies: 4 comments
-
I am under the impression this would be achievable currently by setting the refspecs. Something like: pushOpts := &git.PushOptions{
RefSpecs: []config.RefSpec{
config.RefSpec("+refs/*:refs/*"),
},
Force: true,
}
err = remote.PushContext(context.Background(), pushOpts)
if err != nil {
return err
} But you may need to do an additional push to delete the remote refs that don't exist locally. The refspec for that may look like this. |
Beta Was this translation helpful? Give feedback.
-
Thanks, for the helpful workarounds, but still also hope to see the options available in easy to use flags just like Force for example. |
Beta Was this translation helpful? Give feedback.
-
As a library, Given that the behaviour is already supported, I am moving this as a discussion so that we can gauge other opinions. Overall this could be tackle on several manners:
My preference would probably be the last one as introducing all flags from |
Beta Was this translation helpful? Give feedback.
-
While I don't think aligning git & go-git API is really necessary as long as same things can be achieved, in my opinion, exposing handful shortcuts / "syntax sugar" via options is valuable and can't hurt. Moreover, in this particular example, there is already Lines 49 to 56 in d184322 So adding |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A few push-options missing from go-git
go-git/options.go
Line 223 in 5d08d3b
--all
--mirror
Beta Was this translation helpful? Give feedback.
All reactions