> ## Documentation Index
> Fetch the complete documentation index at: https://developer.upsun.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Change an environment's parent

> Learn how to change a given environment's parent environment.

All environments default to having another environment as their parent.
If you [branched](https://developer.upsun.com/docs/glossary.md#branch) the environment from another,
its parent starts as the environment it was created from.
If you pushed a branch through Git or a [source integration](https://developer.upsun.com/docs/integrations/source),
the parent defaults to the default environment.

To change the environment's parent, follow these steps:

> [tab] In the Console
>
> 1. Select the project where you want to change the parent.
> 2. From the **Environment** menu, select the environment you want to change.
> 3. Click  **Settings**.
> 4. In the row with the environment's name, click \*\*Edit \*\*.
> 5. Select a **Parent environment**.
> 6. Click **Save**.

> [tab] Using the CLI
>
> Run the following command:
>
> ```bash theme={null}
> upsun environment:info -e <CHILD_ENVIRONMENT_NAME> parent <PARENT_ENVIRONMENT_NAME>
> ```
>
> So if you have the environment `new-feature` and want to change its parent to `main`, run the following:
>
> ```bash theme={null}
> upsun environment:info -e new-feature parent main
> ```

If you're not using a [source integration](https://developer.upsun.com/docs/integrations/source),
you can also set a parent for your environment when pushing changes to it.
To do so, run the following command:

```bash theme={null}
git push -o "environment.parent=<PARENT_ENVIRONMENT_NAME>"
```

Learn more about how to [trigger actions on `push`](https://developer.upsun.com/docs/environments#push-options).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.