@@ -138,6 +138,48 @@ The set of repositories to operate on can optionally be restricted by the type:
138138If the command should work on multiple repositories make sure to pass only generic arguments which work for all of these repository types.
139139
140140
141+ Access repositories that require authentication
142+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143+
144+ Vcstool supports authenticated access to repositories by parsing files with a netrc-like format.
145+ It will first look for login information in the ~/.netrc file, used by ftp, git, and similar programs if it exists.
146+ If it doesn't exist (or doesn't contain login infomation for the URL in question), it moves to vcstool-specific locations.
147+ In these locations vcstool will look for credentials in either an `auth.conf ` file, or .conf files inside an `auth.conf.d ` directory.
148+ These locations are (in order of precedence):
149+
150+ 1. User config directory.
151+ - On Linux, abides by XDG spec: `~/.config/vcstool/ `
152+ - On macOS: `~/Library/Application Support/vcstool/ `
153+ - On Windows: `C:\U sers\< username>\A ppData\L ocal\v cstool\v cstool\`
154+ 2. Site config directory.
155+ - On Linux: `vcstool/` subdirectory in any directory within `$XDG_CONFIG_DIRS `, or `/etc/xdg/vcstool/ ` if unset
156+ - On macOS: `/Library/Application Support/vcstool/ `
157+ - On Windows: `C:\P rogramData\v cstool\v cstool\`
158+
159+ The netrc-like format consists of a few different tokens separated by whitespace (spaces, tabs, or newlines):
160+
161+ - `machine <name>`: Credentials are retrieved by matching the repository URL to this token
162+ - `login <name> `: Login username
163+ - `password <string> `: Login password
164+
165+ For example, to access private github repositories:
166+
167+ ```
168+ machine github.com
169+ login mylogin
170+ password myaccesstoken
171+ ```
172+
173+ Accessing private gitlab repositories looks similar, although no `login ` is required:
174+
175+ ```
176+ machine gitlab.com
177+ password myaccesstoken
178+ ```
179+
180+ A word of caution: these files are not encrypted.
181+ Ensure that their permissions do not exeed that which is required.
182+
141183How to install vcstool?
142184=======================
143185
0 commit comments