Function getDefaultRemote

  • Get the name of the default remote: the one matching the repository field in package.json. Throws if options.cwd is not in a git repo or there's no package.json at the repo root.

    The order of preference for returned remotes is:

    1. If repository is defined in package.json, the remote with a matching URL (if options.strict is true, throws an error if no matching remote exists)
    2. upstream if defined
    3. origin if defined
    4. The first defined remote
    5. If there are no defined remotes: throws an error if options.strict is true; otherwise returns origin

    Parameters

    Returns string

    The name of the inferred default remote.

  • Parameters

    • cwd: string

    Returns string

    Deprecated

    Use the object param version

Generated using TypeDoc