This repository was archived by the owner on Sep 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
Modify FAQ.md to address http authentication with git #822
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ Summarize the question and quote the reply, linking back to the original comment | |
* [When should I use `constraint`, `override` `required`, or `ignored` in the Gopkg.toml?](#when-should-i-use-constraint-override-required-or-ignored-in-gopkgtoml) | ||
* [How do I constrain a transitive dependency's version?](#how-do-i-constrain-a-transitive-dependencys-version) | ||
* [Can I put the manifest and lock in the vendor directory?](#can-i-put-the-manifest-and-lock-in-the-vendor-directory) | ||
* [How do I get dep to authenticate to a git repo?](#how-do-i-get-dep-to-authenticate-to-a-git-repo) | ||
|
||
## Behavior | ||
* [How does `dep` decide what version of a dependency to use?](#how-does-dep-decide-what-version-of-a-dependency-to-use) | ||
|
@@ -121,6 +122,42 @@ No. | |
> We prefer to treat the `vendor/` as an implementation detail. | ||
-[@sdboyer on go package management list](https://groups.google.com/d/msg/go-package-management/et1qFUjrkP4/LQFCHP4WBQAJ) | ||
|
||
## How do I get dep to authenticate to a git repo? | ||
|
||
dep currently uses the git command under the hood, so configuring the credentials | ||
for each repository you wish to authenticate to will allow dep to use an | ||
authenticated repository. | ||
|
||
First, configure git to use the credentials option for the specific repository. | ||
Yes, the example.com.username is weird, but it's correct; the 'username' would be | ||
the user repo you're authenticating to access, the 'myusername' is the username | ||
you would use for the actual authentication. | ||
|
||
For example, if you use gitlab, and you wish to access https://gitlab.example.com/example/package.git, | ||
then you would want to use the following configuration: | ||
|
||
`$ git config --global credential.https://gitlab.example.com.example yourusername` | ||
|
||
You also need to tell git what authentication provider you wish to use. You can get | ||
a list of providers, with the following command: | ||
|
||
`$ git help -a | grep credential- | ||
credential-cache remote-fd | ||
credential-cache--daemon remote-ftp | ||
credential-osxkeychain remote-ftps | ||
credential-store remote-http` | ||
|
||
You would then choose an appropriate provider. To use the osxkeychain, then you | ||
would use the following: | ||
|
||
`git config --global credential.helper osxkeychain` | ||
|
||
If you need to do this for a CI system, then you may want to use the "store" provider. | ||
Please see the documentation on how to configure that: https://git-scm.com/docs/git-credential-store | ||
|
||
After configuring git, you may need to use git manually once to have it store the | ||
credentials. Once you've checked out the repo manually, it will then use the stored | ||
credentials. This at least appears to be the behaviour for the osxkeychain. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more consistency nits: American English spellings, please 😄 |
||
|
||
## Behavior | ||
### How does `dep` decide what version of a dependency to use? | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consistency nit: backticks around
git
,dep
, etc.