dotnet-nuget-push(1) | .NET Documentation | dotnet-nuget-push(1) |
This article applies to: ✔️ .NET Core 3.1 SDK and later versions
dotnet-nuget-push - Pushes a package to the server and publishes it.
dotnet nuget push [<ROOT>] [-d|--disable-buffering] [--force-english-output] [--interactive] [-k|--api-key <API_KEY>] [-n|--no-symbols] [--no-service-endpoint] [-s|--source <SOURCE>] [--skip-duplicate] [-sk|--symbol-api-key <API_KEY>] [-ss|--symbol-source <SOURCE>] [-t|--timeout <TIMEOUT>] dotnet nuget push -h|--help
The dotnet nuget push command pushes a package to the server and publishes it. The push command uses server and credential details found in the system’s NuGet config file or chain of config files. For more information on config files, see Configuring NuGet Behavior. NuGet’s default configuration is obtained by loading %AppData%.config (Windows) or $HOME/.nuget/NuGet/NuGet.Config (Linux/macOS), then loading any nuget.config or .nuget.config starting from the root of drive and ending in the current directory.
The command pushes an existing package. It doesn’t create a package. To create a package, use dotnet pack.
This command can store packages in a hierarchical folder structure, which is recommended to optimize performance. It stores packages in a hierarchical folder structure when publishing to a local folder (feed), like nuget add does, if there already is at least one package in the feed that is in a hierarchical folder structure. If the feed has a hierarchical folder structured package already in it, dotnet nuget push respects that structure. So, if you want to publish to a local feed using the .NET CLI instead of the NuGet CLI:
Alternatively, use the NuGet CLI for the first package, then you can use dotnet nuget push for the rest. For more information, see Local feeds.
Specifies the file path to the package to be pushed.
Disables buffering when pushing to an HTTP(S) server to reduce memory usage.
Forces the application to run using an invariant, English-based culture.
Prints out a description of how to use the command.
Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK.
The API key for the server.
Doesn’t push symbols (even if present).
Doesn’t append “api/v2/package” to the source URL.
Specifies the server URL. NuGet identifies a UNC or local folder source and simply copies the file there instead of pushing it using HTTP. > > Starting with NuGet 3.4.2, this is a mandatory parameter unless the NuGet config file specifies a DefaultPushSource value. For more information, see Configuring NuGet behavior.
When pushing multiple packages to an HTTP(S) server, treats any 409 Conflict response as a warning so that other pushes can continue.
The API key for the symbol server.
Specifies the symbol server URL.
Specifies the timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes). Specifying 0 applies the default value.
dotnet nuget push foo.nupkg -k 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a
dotnet nuget push foo.nupkg -k 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -s https://api.nuget.org/v3/index.json
dotnet nuget push foo.nupkg -k 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -s https://customsource/
dotnet nuget push foo.nupkg
dotnet nuget push foo.symbols.nupkg
dotnet nuget push foo.nupkg --timeout 360
dotnet nuget push "*.nupkg"
If this command doesn’t work, it might be due to a bug that existed in older versions of the SDK (.NET Core 2.1 SDK and earlier versions). To fix this, upgrade your SDK version or run the following command instead: dotnet nuget push "**/*.nupkg"
The enclosing quotes are required for shells such as bash that perform file globbing. For more information, see NuGet/Home#4393 (https://github.com/NuGet/Home/issues/4393#issuecomment-667618120).
dotnet nuget push "*.nupkg" --skip-duplicate
dotnet nuget push "*.nupkg" -s c:\mydir
2023-10-25 |