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

Method Pull

git/client.go:893–906  ·  view source on GitHub ↗
(ctx context.Context, remote, branch string, mods ...CommandModifier)

Source from the content-addressed store, hash-verified

891}
892
893func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error {
894 args := []string{"pull", "--ff-only"}
895 if remote != "" && branch != "" {
896 args = append(args, remote, branch)
897 }
898 cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...)
899 if err != nil {
900 return err
901 }
902 for _, mod := range mods {
903 mod(cmd)
904 }
905 return cmd.Run()
906}
907
908func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error {
909 args := []string{"push", "--set-upstream", remote, ref}

Calls 2

AuthenticatedCommandMethod · 0.95
RunMethod · 0.65