1dotnet-nuget-push(1)          .NET Documentation          dotnet-nuget-push(1)
2
3
4

dotnet nuget push

6       This article applies to: ✔️ .NET Core 3.1 SDK and later versions
7

NAME

9       dotnet-nuget-push - Pushes a package to the server and publishes it.
10

SYNOPSIS

12              dotnet nuget push [<ROOT>] [-d|--disable-buffering] [--force-english-output]
13                  [--interactive] [-k|--api-key <API_KEY>] [-n|--no-symbols]
14                  [--no-service-endpoint] [-s|--source <SOURCE>] [--skip-duplicate]
15                  [-sk|--symbol-api-key <API_KEY>] [-ss|--symbol-source <SOURCE>]
16                  [-t|--timeout <TIMEOUT>]
17
18              dotnet nuget push -h|--help
19

DESCRIPTION

21       The  dotnet  nuget push command pushes a package to the server and pub‐
22       lishes it.  The push command uses server and credential  details  found
23       in  the  system’s NuGet config file or chain of config files.  For more
24       information on config files, see Configuring NuGet  Behavior.   NuGet’s
25       default configuration is obtained by loading %AppData%.config (Windows)
26       or  $HOME/.nuget/NuGet/NuGet.Config  (Linux/macOS),  then  loading  any
27       nuget.config  or .nuget.config starting from the root of drive and end‐
28       ing in the current directory.
29
30       The command pushes an existing package.  It doesn’t create  a  package.
31       To create a package, use dotnet pack.
32

ARGUMENTS

34ROOT
35
36         Specifies the file path to the package to be pushed.
37

OPTIONS

39-d|--disable-buffering
40
41         Disables buffering when pushing to an HTTP(S) server to reduce memory
42         usage.
43
44--force-english-output
45
46         Forces the application to run using an invariant, English-based  cul‐
47         ture.
48
49-?|-h|--help
50
51         Prints out a description of how to use the command.
52
53--interactive
54
55         Allows  the  command  to stop and wait for user input or action.  For
56         example, to complete authentication.  Available since .NET  Core  3.0
57         SDK.
58
59-k|--api-key <API_KEY>
60
61         The API key for the server.
62
63-n|--no-symbols
64
65         Doesn’t push symbols (even if present).
66
67--no-service-endpoint
68
69         Doesn’t append “api/v2/package” to the source URL.
70
71-s|--source <SOURCE>
72
73         Specifies  the  server  URL.   NuGet identifies a UNC or local folder
74         source and simply copies the file there instead of pushing  it  using
75         HTTP.   >  > Starting with NuGet 3.4.2, this is a mandatory parameter
76         unless the NuGet config file  specifies  a  DefaultPushSource  value.
77         For more information, see Configuring NuGet behavior.
78
79--skip-duplicate
80
81         When  pushing  multiple packages to an HTTP(S) server, treats any 409
82         Conflict response as a warning so that the push can continue.
83
84-sk|--symbol-api-key <API_KEY>
85
86         The API key for the symbol server.
87
88-ss|--symbol-source <SOURCE>
89
90         Specifies the symbol server URL.
91
92-t|--timeout <TIMEOUT>
93
94         Specifies the timeout for pushing to a server in  seconds.   Defaults
95         to 300 seconds (5 minutes).  Specifying 0 applies the default value.
96

EXAMPLES

98       • Push foo.nupkg to the default push source specified in the NuGet con‐
99         fig file, using an API key:
100
101                dotnet nuget push foo.nupkg -k 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a
102
103       • Push foo.nupkg to the official NuGet server, specifying an API key:
104
105                dotnet nuget push foo.nupkg -k 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -s https://api.nuget.org/v3/index.json
106
107       • Push foo.nupkg to the custom push source https://customsource, speci‐
108         fying an API key:
109
110                dotnet nuget push foo.nupkg -k 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -s https://customsource/
111
112       • Push foo.nupkg to the default push source specified in the NuGet con‐
113         fig file:
114
115                dotnet nuget push foo.nupkg
116
117       • Push foo.symbols.nupkg to the default symbols source:
118
119                dotnet nuget push foo.symbols.nupkg
120
121       • Push foo.nupkg to the default push source specified in the NuGet con‐
122         fig file, with a 360-second timeout:
123
124                dotnet nuget push foo.nupkg --timeout 360
125
126       • Push  all  .nupkg  files in the current directory to the default push
127         source specified in the NuGet config file:
128
129                dotnet nuget push "*.nupkg"
130
131                If this command doesn’t work, it might be due to  a  bug  that
132                existed  in  older  versions of the SDK (.NET Core 2.1 SDK and
133                earlier versions).  To fix this, upgrade your SDK  version  or
134                run   the   following   command  instead:  dotnet  nuget  push
135                "**/*.nupkg"
136
137                The enclosing quotes are required for shells such as bash that
138                perform    file   globbing.    For   more   information,   see
139                NuGet/Home#4393 (https://github.com/NuGet/Home/issues/4393#is‐
140                suecomment-667618120).
141
142       • Push  all  .nupkg  files  to the default push source specified in the
143         NuGet config file, even if a 409 Conflict response is returned by  an
144         HTTP(S) server:
145
146                dotnet nuget push "*.nupkg" --skip-duplicate
147
148       • Push all .nupkg files in the current directory to a local feed direc‐
149         tory:
150
151                dotnet nuget push "*.nupkg" -s c:\mydir
152
153       • For pushing to Azure Artifacts, see Azure Artifacts’ push  documenta‐
154         tion.
155
156         This  command  doesn’t store packages in a hierarchical folder struc‐
157         ture, which is recommended to optimize performance.  For more  infor‐
158         mation, see Local feeds.
159
160
161
162                                  2022-10-10              dotnet-nuget-push(1)
Impressum