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

Method Pull

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

Source from the content-addressed store, hash-verified

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

Callers 1

TestClientPullFunction · 0.95

Calls 2

AuthenticatedCommandMethod · 0.95
RunMethod · 0.65

Tested by 1

TestClientPullFunction · 0.76