Missing push options --all --mirror #1054
Replies: 3 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.
-
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