Upsun User Documentation

Make changes to your project

Sign up

Get your free trial by clicking the link below.

Get your Upsun free trial

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 Anchor to this heading

Create a new environment (a Git branch) to make changes without impacting production:

Run the following command:

upsun branch feat-a

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 Anchor to this heading

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

3. Commit your changes Anchor to this heading

git add index.js
git commit -m "Update source code"

4. Deploy your changes Anchor to this heading

Deploy your changes to the feat-a environment:

upsun push

Note that each environment has its own domain name. To open the URL of your new environment, run the following command:

upsun environment:url --primary

5. Iterate Anchor to this heading

Iterate by changing the code, committing, and deploying. When satisfied with your changes, merge them to the main branch, and remove the feature branch:

upsun merge
 Are you sure you want to merge feat-a into its parent, main? [Y/n] y
upsun checkout main
git pull upsun main
upsun environment:delete feat-a
git fetch --prune

6. Keep your branch up to date Anchor to this heading

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.

Is this page helpful?