简体   繁体   English

go-git 相当于“git push --all<remote> “</remote>

[英]go-git equivalent to "git push --all <remote>"

Having trouble finding a way to push all branches to a remote using go-git without iterating all branches.在不迭代所有分支的情况下,无法找到一种使用go-git将所有分支推送到远程的方法。 I've looked at the PushOptions definition, and I'm not seeing an option that correlates to git push --all <remote> .我查看了PushOptions定义,但没有看到与git push --all <remote>相关的选项。 Has anyone accomplished this?有没有人做到这一点?

You are correct.你是对的。 You'd iterate all references yourself and create a refspec for each and add them to PushOptions.RefSpecs .您将自己迭代所有引用并为每个引用创建一个 refspec 并将它们添加到PushOptions.RefSpecs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM