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.
To enable this command for NuGet versions before 3.2, go to https://nuget.codeplex.com/releases, select the newest stable release, download
Nuget-Signed.exe to your local disk and rename
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
|ApiKey||The API key for the target repository. If not present, the one specified in the config file is used (
|Help||Displays help information for the command.|
|NoCache||Prevents NuGet from using cached packages. See Managing the global packages and cache folders.|
|Noop||Logs what would be done but does not perform the actions; assumes success for push operations.|
|PreRelease||Includes prerelease packages in the mirroring operation.|
|Source||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.|
|Timeout||Specifies the timeout, in seconds, for pushing to a server. The default is 300 seconds (5 minutes).|
|Version||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