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

Method Push

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

Source from the content-addressed store, hash-verified

906}
907
908func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error {
909 args := []string{"push", "--set-upstream", remote, ref}
910 cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...)
911 if err != nil {
912 return err
913 }
914 for _, mod := range mods {
915 mod(cmd)
916 }
917 return cmd.Run()
918}
919
920func (c *Client) Clone(ctx context.Context, cloneURL string, args []string, mods ...CommandModifier) (string, error) {
921 // Note that even if this is an SSH clone URL, we are setting the pattern anyway.

Calls 2

AuthenticatedCommandMethod · 0.95
RunMethod · 0.65