Artifactspublic-v0

curl

master
ply4 git calls38 ms288 KiB3 cachedprotocol v2
52 lines1.8 KiBRaw

--netrc

Make curl scan the .netrc file in the user's home directory for login name and password. This is typically used for FTP on Unix. If used with HTTP, curl enables user authentication. See netrc(5) and ftp(1) for details on the file format. curl does not complain if that file does not have the right permissions (it should be neither world- nor group-readable). The environment variable HOME is used to find the home directory. If the NETRC environment variable is set, that filename is used as the netrc file. (Added in 8.16.0)

If --netrc-file is used, that overrides all other ways to figure out the file.

The netrc file provides credentials for a hostname independent of which protocol and port number that are used.

On Windows two filenames in the home directory are checked: .netrc and _netrc, preferring the former. Older versions on Windows checked for _netrc only.

A quick and simple example of how to setup a .netrc to allow curl to access the machine host.example.com with username myself and password secret could look similar to:

machine host.example.com
login myself
password secret

curl also supports the default keyword. This is the same as machine name except that default matches any name. There can be only one default token, and it must be after all machine tokens.

When providing a username in the URL and a .netrc file, curl looks for the password for that specific user for the given host if such an entry appears in the file before a "generic" machine entry without login specified.

1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: netrc
5Short: n
6Help: Must read .netrc for username and password
7Category: auth
8Added: 4.6
9Mutexed: netrc-file netrc-optional
10Multi: boolean
11See-also:
12 - netrc-file
13 - config
14 - user
15Example:
16 - --netrc $URL
17---
19# `--netrc`
21Make curl scan the *.netrc* file in the user's home directory for login name
22and password. This is typically used for FTP on Unix. If used with HTTP, curl
23enables user authentication. See *netrc(5)* and *ftp(1)* for details on the
24file format. curl does not complain if that file does not have the right
25permissions (it should be neither world- nor group-readable). The environment
26variable `HOME` is used to find the home directory. If the `NETRC` environment
27variable is set, that filename is used as the netrc file. (Added in 8.16.0)
29If --netrc-file is used, that overrides all other ways to figure out the file.
31The netrc file provides credentials for a hostname independent of which
32protocol and port number that are used.
34On Windows two filenames in the home directory are checked: *.netrc* and
35*_netrc*, preferring the former. Older versions on Windows checked for
36*_netrc* only.
38A quick and simple example of how to setup a *.netrc* to allow curl to access
39the machine host.example.com with username `myself` and password `secret`
40could look similar to:
42 machine host.example.com
43 login myself
44 password secret
46curl also supports the `default` keyword. This is the same as machine name
47except that default matches any name. There can be only one `default` token,
48and it must be after all machine tokens.
50When providing a username in the URL and a *.netrc* file, curl looks for the
51password for that specific user for the given host if such an entry appears in
52the file before a "generic" `machine` entry without `login` specified.
Diagnostics4 git calls · 38 ms
CallStatusSizeTime038 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2001.0 KiB · hit33 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=33
git.response.bytes=1037
git.response.cache=HIT
git.response.duration_ms=33
git.fetch.wants=03a7ed6e5ded0cd6821109b8dd550922a4d9cb69
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1037
git.pkt.payload.max=1016
git.sideband.band1.bytes=1015
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e30e232b8d8a31
Request
12bad5b3…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format