Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
无法找到一种方法将所有分支推送到远程使用go-git而不迭代所有分支。我查看了PushOptions定义,但没有看到与git push --all <remote>. 有没有人做到这一点?
go-git
PushOptions
git push --all <remote>
你是对的。您将自己迭代所有引用并为每个引用创建一个 refspec 并将它们添加到PushOptions.RefSpecs.
PushOptions.RefSpecs