From 0fb65be9e0b4b2d0a62f2628f116f2c3b71831dd Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:42:13 -0400 Subject: [PATCH 1/4] Adding --profile flag info --- website/docs/reference/commands/init.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/website/docs/reference/commands/init.md b/website/docs/reference/commands/init.md index 468bee5ff60..1b07986bf00 100644 --- a/website/docs/reference/commands/init.md +++ b/website/docs/reference/commands/init.md @@ -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). + + +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. + + + ## 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: From ee4a2314b433cfdd146580fcde50908298d92b0e Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:56:26 -0400 Subject: [PATCH 2/4] Update website/docs/reference/commands/init.md --- website/docs/reference/commands/init.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/commands/init.md b/website/docs/reference/commands/init.md index 1b07986bf00..aff5c0d4827 100644 --- a/website/docs/reference/commands/init.md +++ b/website/docs/reference/commands/init.md @@ -19,7 +19,7 @@ Then, it will: -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. +Use the `--profile` flag with `dbt init` to initialize the project with an existing `profiles.yml` 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. From dd9b82ed1ac023fabb41ddd076c60f04e26d2201 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:12:23 -0400 Subject: [PATCH 3/4] Update website/docs/reference/commands/init.md Co-authored-by: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/commands/init.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/commands/init.md b/website/docs/reference/commands/init.md index aff5c0d4827..f73658ab0fa 100644 --- a/website/docs/reference/commands/init.md +++ b/website/docs/reference/commands/init.md @@ -21,7 +21,7 @@ Then, it will: Use the `--profile` flag with `dbt init` to initialize the project with an existing `profiles.yml` 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. +If the profile does not exist in `profiles.yml` or the command is run inside an existing project, the command raises an error. From bcb668ee7a15293064799af430bb3c84090b09b6 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:13:52 -0400 Subject: [PATCH 4/4] Update website/docs/reference/commands/init.md Co-authored-by: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/commands/init.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/commands/init.md b/website/docs/reference/commands/init.md index f73658ab0fa..9cbbf3bb61d 100644 --- a/website/docs/reference/commands/init.md +++ b/website/docs/reference/commands/init.md @@ -19,7 +19,9 @@ Then, it will: -Use the `--profile` flag with `dbt init` to initialize the project with an existing `profiles.yml` as the `profile:` key instead of creating a new one. +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.