mirror command (NuGet CLI)
Applies to: package publishing • Supported versions: deprecated in 3.2+
Mirrors a package and its dependencies from the specified source repositories to the target repository.
NuGet.ServerExtensions.dll and NuGet-Signed.exe that previously supported this command in NuGet 2.x (by renaming NuGet-Signed.exe to nuget.exe) are no longer available for download. To use a command similar to this, try NuGetMirror.
nuget mirror <packageID | configFilePath> <listUrlTarget> <publishUrlTarget> [options]
<packageID> is the package to mirror, or
<configFilePath> identifies the
packages.config file that lists the packages to mirror.
<listUrlTarget> specifies the source repository, and
<publishUrlTarget> specifies the target repository.
If your target repository is on
https://machine/repo that's running NuGet.Server, the list and push urls will be
The API key for the target repository. If not present, the one specified in the config file is used (
Displays help information for the command.
Prevents NuGet from using cached packages. See Managing the global packages and cache folders.
Logs what would be done but does not perform the actions; assumes success for push operations.
Includes prerelease packages in the mirroring operation.
A list of package sources to mirror. If no sources are specified, the ones defined in the config file (see ApiKey above) are used, defaulting to nuget.org if none are specified.
Specifies the timeout, in seconds, for pushing to a server. The default is 300 seconds (5 minutes).
The version of the package to install. If not specified, the latest version is mirrored.
Also see Environment variables
nuget mirror packages.config https://MyRepo/nuget https://MyRepo/api/v2/package -source https://nuget.org/api/v2 -apikey myApiKey -nocache nuget mirror Microsoft.AspNet.Mvc https://MyRepo/nuget https://MyRepo/api/v2/package -version 4.0.20505.0 nuget mirror Microsoft.Net.Http https://MyRepo/nuget https://MyRepo/api/v2/package -prerelease