Skip to content

Commit

Permalink
Adding --profile flag info (#4143)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

Adding info from[ this
issue](#4080) around
`dbt init --profile`

## Checklist
- [x] Add versioning components, as described in [Versioning
Docs](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-entire-pages)

- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [x] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."
  • Loading branch information
matthewshaver authored Oct 10, 2023
2 parents bdbfa4b + ae9d583 commit 1d7a16e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions website/docs/reference/commands/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,21 @@ Then, it will:
- Create a new folder with your project name and sample files, enough to get you started with dbt
- Create a connection profile on your local machine. The default location is `~/.dbt/profiles.yml`. Read more in [configuring your profile](/docs/core/connect-data-platform/connection-profiles).

<VersionBlock firstVersion="1.7">

When using `dbt init` to initialize your project, include the `--profile` flag to specify an existing `profiles.yml` as the `profile:` key to use instead of creating a new one. For example, `dbt init --profile`.



If the profile does not exist in `profiles.yml` or the command is run inside an existing project, the command raises an error.

</VersionBlock>

## Existing project

If you've just cloned or downloaded an existing dbt project, `dbt init` can still help you set up your connection profile so that you can start working quickly. It will prompt you for connection information, as above, and add a profile (using the `profile` name from the project) to your local `profiles.yml`, or create the file if it doesn't already exist.


## profile_template.yml

`dbt init` knows how to prompt for connection information by looking for a file named `profile_template.yml`. It will look for this file in two places:
Expand Down

0 comments on commit 1d7a16e

Please sign in to comment.