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

Method DeleteLocalBranch

git/client.go:665–676  ·  view source on GitHub ↗
(ctx context.Context, branch string)

Source from the content-addressed store, hash-verified

663}
664
665func (c *Client) DeleteLocalBranch(ctx context.Context, branch string) error {
666 args := []string{"branch", "-D", branch}
667 cmd, err := c.Command(ctx, args...)
668 if err != nil {
669 return err
670 }
671 _, err = cmd.Output()
672 if err != nil {
673 return err
674 }
675 return nil
676}
677
678func (c *Client) CheckoutBranch(ctx context.Context, branch string) error {
679 args := []string{"checkout", branch}

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65