MCPcopy Create free account
hub / github.com/cli/cli / SetRemoteBranches

Method SetRemoteBranches

git/client.go:830–841  ·  view source on GitHub ↗
(ctx context.Context, remote string, refspec string)

Source from the content-addressed store, hash-verified

828}
829
830func (c *Client) SetRemoteBranches(ctx context.Context, remote string, refspec string) error {
831 args := []string{"remote", "set-branches", remote, refspec}
832 cmd, err := c.Command(ctx, args...)
833 if err != nil {
834 return err
835 }
836 _, err = cmd.Output()
837 if err != nil {
838 return err
839 }
840 return nil
841}
842
843func (c *Client) AddRemote(ctx context.Context, name, urlStr string, trackingBranches []string) (*Remote, error) {
844 args := []string{"remote", "add"}

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65