> The complete documentation index is at [llms.txt](/llms.txt).

In the [Quick Start](/tutorial/quick-start#create-a-branch) you created a branch and ran a pipeline on it. This guide goes deeper into branches - importing external data and merging results back to `main`.

If you don't already have a branch, create one now:

```sh
bauplan checkout -b <YOUR_USERNAME>.hello_bauplan
```

You can see your current branch marked with a star by running:

```sh
bauplan branch ls   # list your branches (active branch is marked with a star)
```

## Import data in a branch

To import data into a branch, you'll need a public S3 bucket with
ListObject permission enabled
([here is an example of JSON S3 permissions](/tutorial/s3-permissions))

We provide a public bucket with an [open
dataset](https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page)
to get started.

Make sure you're in your target branch:

```sh
bauplan branch checkout <YOUR_USERNAME>.<YOUR_BRANCH_NAME>
```

Then create and import a new table:

```sh
bauplan table create <YOUR_USERNAME>_green_taxi_table --search-uri 's3://alpha-hello-bauplan/green-taxi/*.parquet'
bauplan table import <YOUR_USERNAME>_green_taxi_table --search-uri 's3://alpha-hello-bauplan/green-taxi/*.parquet'
```

To verify the table creation:

```sh
bauplan table get <YOUR_USERNAME>_green_taxi_table
```

For detailed information about importing data, schema conflict
resolution, and using the Python SDK for imports, see the
[importing data](/tutorial/import) page.

## Merge a branch

To merge your `hello_bauplan` branch into the `main` branch:

1.  Review the differences between branches:

    ```sh
    bauplan branch diff main
    ```

    You can compare your active branch with the main branch to
    identify the differences. This comparison will show which tables
    exist in one branch but not the other.

2.  Switch to main and merge:

    ```sh
    bauplan branch checkout main
    bauplan branch merge <YOUR_USERNAME>.<YOUR_BRANCH_NAME>
    ```

3.  Check the schema of the merged table:

    ```sh
    bauplan table ls
    bauplan table get <YOUR_USERNAME>_green_taxi_table
    ```

You can now query the table. For example, to find out how many records
are in the table:

```sh
bauplan query "SELECT COUNT(lpep_pickup_datetime) as number_of_trips FROM <YOUR_USERNAME>_green_taxi_table"
```

Congratulations, you just merged a data branch into the main data
catalog!

> - Data branches are user-specific; always prefix branch names with your
>   username. 
>   - For a complete command reference, please consult our [reference
>   documentation](/reference/bauplan). 
>   - The bauplan data catalog supports
>   additional operations like namespace management, removing tables, and deleting
>   branches. See [CLI Reference](/reference/cli.mdx) for more details.