Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Modify FAQ.md to address http authentication with git #822

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Copy link
Member

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.

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.
Copy link
Member

Choose a reason for hiding this comment

The 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?
Expand Down