# Git workflow

Git is the source of truth for all Comind.work app code. Every change you make - whether to actions, views, or configuration - lives in your Git repository, and `npx comind install` is the single command that deploys it to a workspace.

## The safe workflow[​](#the-safe-workflow "Direct link to The safe workflow")

Follow these four steps every time you work on app code:

<!-- -->

### Step 1: Edit locally[​](#step-1-edit-locally "Direct link to Step 1: Edit locally")

Make your changes in your local editor or Codespace. All app source files live in the repository under their respective app folders.

### Step 2: Install to deploy[​](#step-2-install-to-deploy "Direct link to Step 2: Install to deploy")

Deploy your changes to the target environment:

```
npx comind install app-your-task
```

The `install` command compiles and uploads your app in a single atomic operation.

### Step 3: Verify on the site[​](#step-3-verify-on-the-site "Direct link to Step 3: Verify on the site")

Open the Comind.work site and confirm your changes work as expected. Test the relevant views, actions, and workflows before moving on.

### Step 4: Commit to Git[​](#step-4-commit-to-git "Direct link to Step 4: Commit to Git")

Once verified, commit your changes:

```
git add app-your-task/
git commit -m "Describe what you changed and why"
```

## Branching strategy[​](#branching-strategy "Direct link to Branching strategy")

Comind.work repositories use two long-lived branches:

| Branch | Deploys to              | Requirements                  |
| ------ | ----------------------- | ----------------------------- |
| `main` | Development environment | Standard commits              |
| `prod` | Production environment  | Signed commits by admin users |

### Main branch[​](#main-branch "Direct link to Main branch")

The `main` branch auto-deploys to the development environment. All day-to-day work happens here. Use feature branches and pull requests if your team prefers code review before merging to `main`.

### Prod branch[​](#prod-branch "Direct link to Prod branch")

The `prod` branch auto-deploys to production. Pushes to `prod` require signed commits from admin users - this ensures only verified, trusted code reaches production.

To set up commit signing, follow the [signed commits guide](/developer-guide/getting-started/sign-commits.md).

## Single source: code in Git[​](#single-source-code-in-git "Direct link to Single source: code in Git")

Once an app lives in Git, code is the only source of truth. Edits made directly in the web UI editor are not automatically synced back to your repository and will be overwritten by the next `install`. Keep all changes in code, review them through pull requests, and deploy from there.
