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

Method Push

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

Source from the content-addressed store, hash-verified

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

Callers 4

TestClientPushFunction · 0.95
createFromLocalFunction · 0.80
ensurePushedFunction · 0.80
handlePushFunction · 0.80

Calls 2

AuthenticatedCommandMethod · 0.95
RunMethod · 0.65

Tested by 1

TestClientPushFunction · 0.76