Skip to content

Commit

Permalink
docs(git): tell how to pass HTTPS credentials (#1782)
Browse files Browse the repository at this point in the history
Fixes #466
  • Loading branch information
yajo authored Sep 21, 2024
1 parent 04dc881 commit 426f5cc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,22 @@ $ copier copy -r HEAD ./src ./dst

... then you'll notice `new-file.txt` does exist. You passed a specific ref to copy, so
Copier skips its autodetection and just goes for the `HEAD` you already chose.

## How to pass credentials to Git?

If you do something like this, and the template supports updates, you'll notice that the
credentials will end up stored in [the answers file][file][the-copier-answersyml-file]:

```shell
copier copy https://myuser:example.com/repo.git .
```

To avoid that, the simplest fix is to clone using SSH with cryptographic key
authentication. If you cannot do that, then check out these links for strategies on
passing HTTPS credentials to Git:

- https://github.com/copier-org/copier/issues/466#issuecomment-2338160284
- https://stackoverflow.com/q/35942754
- https://git-scm.com/docs/gitcredentials
- https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage#_credential_caching
- https://github.com/topics/git-credential-helper

0 comments on commit 426f5cc

Please sign in to comment.