Skip to main content
Upsun allows you to make changes to your project and test them on a preview environment before introducing them to Production. In your project, the default branch (e.g. main, master, whichever chosen during project creation) always represents the production environment. Other branches are for developing new features, fixing bugs, or updating the infrastructure. To make changes to your project, follow these steps:

1. Create a new environment

Create a new environment (a Git branch) to make changes without impacting production: Run the following command:
Terminal
This creates a new local feat-a Git branch based on the main Git branch and activates a related environment on Upsun. The new environment inherits the data (service data and assets) of its parent environment (the production environment here).

2. Make changes to your project

Depending on the stack you’re using, change something within your source code.

3. Commit your changes

Terminal

4. Deploy your changes

Deploy your changes to the feat-a environment:
Terminal
Note that each environment has its own domain name. To open the URL of your new environment, run the following command:
Terminal

Warnings

If your environment is inactive, you need to activate it first, using the following command:
Terminal

5. Iterate

Iterate by changing the code, committing, and deploying. When satisfied with your changes, merge them to the main branch, and remove the feature branch:
Terminal
Deploying after a merge is fast because the image built for the feature environment is reused for the targeted environment.

6. Keep your branch up to date

For a long running development branch, to keep the code up-to-date with the main branch, use git merge main or git rebase main. You can also keep the data in sync with the parent environment by using upsun env:sync data.
Last modified on March 12, 2026