Skip to content

Commit

Permalink
Adding --profile flag info
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewshaver committed Sep 27, 2023
1 parent eb861dd commit 0fb65be
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions website/docs/reference/commands/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@ 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">

If `--profile` flag is specified with `dbt init`, and the profile exists in `profiles.yml`, the project will initialize with that as the `profile:` key instead of creating a new one.

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 0fb65be

Please sign in to comment.