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

Method Fetch

git/client.go:878–891  ·  view source on GitHub ↗

Below are commands that make network calls and need authentication credentials supplied from gh.

(ctx context.Context, remote string, refspec string, mods ...CommandModifier)

Source from the content-addressed store, hash-verified

876// Below are commands that make network calls and need authentication credentials supplied from gh.
877
878func (c *Client) Fetch(ctx context.Context, remote string, refspec string, mods ...CommandModifier) error {
879 args := []string{"fetch", remote}
880 if refspec != "" {
881 args = append(args, refspec)
882 }
883 cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...)
884 if err != nil {
885 return err
886 }
887 for _, mod := range mods {
888 mod(cmd)
889 }
890 return cmd.Run()
891}
892
893func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error {
894 args := []string{"pull", "--ff-only"}

Calls 2

AuthenticatedCommandMethod · 0.95
RunMethod · 0.65