﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Integration

> Connect your Base44 app to GitHub for version control, local development, and collaboration.

Set up GitHub integration to edit your Base44 app locally and sync changes automatically.

> [!TIP]
>
> Already have your app's code in a GitHub repository? Connecting an app you build in Base44 creates a new repository for it. To work on code that's already on GitHub, use [Base Code](https://docs.base44.com/base-code/getting-started.md) instead.

## Sync your app with GitHub

Connect your app to GitHub to write code in your local development environment or in Base44 and keep them in sync with each other.

![GitHub connection prompt.](https://mintcdn.com/base44/8-JwIy7QUSD-rZKI/images/ConnectGitHub.png?fit=max\&auto=format\&n=8-JwIy7QUSD-rZKI\&q=85\&s=4ec089fc2931c1bdfb98c4aca283182b)

Connect to GitHub for 2-way sync

> [!WARNING]
>
> **Important:**
>
> * GitHub 2 way sync requires the [**Builder plan**](https://base44.com/pricing) or higher.
> * Only app owners can connect an app to a repository or reconnect it.
> * If you previously connected to GitHub using the legacy Export to GitHub 1-way integration, click **Looking for the old setup?** in the GitHub panel to disconnect it and reconnect using 2-way sync.
> * When you connect your app to GitHub, your changes are synced to the connected repository automatically. There’s no option to manually push updates from your Base44 app to GitHub.
> * After you connect GitHub to your app, you cannot use Version History to revert to versions from before the GitHub integration. Those older versions are not stored in your GitHub repository, so trying to revert to them results in an error. Only versions that exist in the connected GitHub repo are available to restore.

> [tab] From the app editor
>
> **To sync your app with GitHub:**
>
> 1. Click **Dashboard** in your app editor.
> 2. Click the **GitHub** icon at the top-right and click **Connect to GitHub**.
> 3. Click **Connect GitHub**.
> 4. Click **Authorize Base44 Builder**.
> 5. Choose where to install the **Base44 Builder**:
>    * Select the GitHub **organization** or account.
>    * Choose which **repositories** to allow access.
> 6. Click **Install**.
> 7. Create a repository for your app:
>    * Choose the GitHub **organization** or account.
>    * Enter a name for the new repository.
>    * Click **Create Repository**.

> [tab] From the Overview page
>
> If you created your app with the [Base44 CLI](https://docs.base44.com/developers/backend/overview/introduction.md), link its GitHub repository from the app's **Overview** page to start editing the app in Base44. Only the app owner sees this option, and only before the app's code is managed in Base44.
>
> > [!TIP]
> >
> > The repository needs a `base44/config.jsonc` whose project name matches the app's name, and its default branch must be `main`. Install the [Base44 GitHub App](#sync-your-app-with-github) on the repository with write access first.
>
> **To link a CLI-created app to its repository:**
>
> 1. Open your app's **Overview** page in Base44.
>
> 2. Click **Link GitHub repo**.
>
> 3. If you haven't connected a GitHub account yet, click **Connect GitHub**.
>
> 4. Search for and select the repository you created the app from with the CLI.
>
> 5. Click **Link repository**.
>
> > [!WARNING]
> >
> > The repository becomes your app's source of truth. Entities, agents, and functions you already deployed with the Base44 CLI are replaced by their versions in the repository. After linking, continue building in the app editor instead of running `base44 deploy`.

> [!TIP]
>
> After connecting, click the **GitHub** icon in the top panel, then click **Go
> to Repository**.

![GitHub showing Connected status and a Go to Repository button.](https://mintcdn.com/base44/1XKVITb5fS-y3pOa/images/GitHubConnected.png?fit=max\&auto=format\&n=1XKVITb5fS-y3pOa\&q=85\&s=9bf1709369734893b91dfbb8897ec768)

View your connected GitHub repository

## How your team writes to GitHub

GitHub connections belong to your workspace, not to one person's account. Workspace admins manage them in **Workspace settings** > **GitHub**, and sync keeps working if the member who connected an organization leaves the workspace.

Your workspace admin chooses how members write to GitHub. The setting applies to every app in the workspace that syncs with GitHub:

* **Shared connection:** Everyone writes through the workspace's connection, without connecting a GitHub account of their own. Commits show Base44 as the author. This is the default.
* **Per user connection:** Each member connects their own GitHub account and gets the access GitHub already gives them. Members without write access to the repository can't edit or publish the app. Commits show under the member's own name.

Base Code apps always use per user connections.

> [!NOTE]
>
> **How organizations work in your workspace:**
>
> * When you create a repository, you only see the GitHub organizations your workspace allows.
> * By default, only workspace owners and admins can add a new organization. Admins can let Editors add organizations too.
> * Connections made before GitHub moved to the workspace were moved automatically, so you don't need to reconnect.

## Set up your local development environment

After connecting to GitHub, set up your local repository to start editing code in your preferred development environment.

To set up your local repository:

1. Clone the repository using the project's Git URL.
2. Navigate to the project directory.
3. Install dependencies: `npm install`.
4. Install the Base44 CLI: `npm install -g base44@latest`.
5. Authenticate: [`base44 login`](https://docs.base44.com/developers/references/cli/commands/login).
6. Link the clone to its app: [`base44 link`](https://docs.base44.com/developers/references/cli/commands/link). The `base44/.app.jsonc` link pointer is gitignored, so every fresh clone needs this step.

**Run the app locally:**

```bash theme={null}
base44 dev
```

This starts a local Base44 backend and your frontend dev server together. The frontend's `/api` requests are proxied to the local backend. See [Local development](https://docs.base44.com/developers/backend/overview/local-dev/local-development-overview.md) for what runs locally.

To work on only the frontend against your app's live hosted backend, run `base44 dev --remote` instead.

> [!WARNING]
>
> In remote mode, writes go to your live app's production data.

For details on the exported file structure, see [Project Structure](https://docs.base44.com/developers/app-code/overview/project-structure.md).

### Sync local changes to Base44

To sync your local changes to Base44, merge the changes to the main git branch. This branch must be named `main`. Other default branch names, such as `master`, currently aren't supported.  Base44 pulls the merged changes so that they appear in your app whenever you open or are in the app editor.

After syncing, click **Publish** in the top right corner of your Base44 app to make the changes live for users.

### Deploy backend features

Merging to `main` syncs your code to Base44, but it doesn't deploy every backend resource. This table describes the behavior and required steps to deploy each resource after your project syncs:

| Resource | After merge | Publish required |
| - | - | - |
| Backend functions | Base44 deploys the changed functions to preview. | Yes. Publishing deploys them to production. |
| Entities | Base44 updates the schema in preview and production. | No. |
| Agents | Base44 updates the agents in preview and production. | No. |

> [!WARNING]
>
> Base44 syncs from your remote repository on GitHub. Avoid deploying backend features with CLI deploy commands, such as [`base44 deploy`](https://docs.base44.com/developers/references/cli/commands/deploy), [`base44 functions deploy`](https://docs.base44.com/developers/references/cli/commands/functions-deploy), [`base44 entities push`](https://docs.base44.com/developers/references/cli/commands/entities-push), and [`base44 agents push`](https://docs.base44.com/developers/references/cli/commands/agents-push). These commands register your backend features with Base44 directly and bypass the remote repository. The next time Base44 syncs from the repository, it overwrites any changes the repository doesn't contain, including anything you deployed with CLI commands. To make sure your backend features sync correctly, merge your changes to `main` instead, and use `base44 dev` to test locally.

## Sync remote changes locally

When you make changes in the Base44 app editor or restore an earlier version from Version History, Base44 pushes a new commit to `main`. Your local clone doesn't receive these commits automatically, so it can fall behind the repository.

Pull `main` into your local clone before you push again. Git rejects a push from a local project that doesn't have the commits Base44 added.

### Resolve merge conflicts

A merge conflict occurs when a commit in your repository and a change in Base44 edit the same lines of a file. Base44 can't handle merge conflicts automatically. Instead, the app editor chat lists the conflicting files and prompts you to click **Resolve Conflicts with AI**, which uses credits.

## Disconnect from GitHub

You can disconnect a specific app from its GitHub repository, or disconnect a GitHub organization from your whole workspace. Moving an app to another workspace also disconnects its GitHub sync, and Base44 warns you before it does.

> [!NOTE]
>
> If you don't see **Disconnect** in the GitHub panel, it isn't enabled for your account yet. Sync can't be paused, so the only states are connected and disconnected.

### Disconnect your repository

Disconnect your app from its GitHub repository if you no longer want to sync changes. Only the app owner or the member who connected the repository can disconnect it.

**To disconnect your repository:**

1. Open the code tab.
2. Click **GitHub**.
3. Click the **More actions** icon .
4. Click **Disconnect**.

The disconnect process takes approximately 30 seconds and is only available when the AI agent is not actively making changes to your app.

### Reconnect your repository

Reconnect your app to the repository it was disconnected from to resume syncing. Only the app owner can reconnect.

> [!WARNING]
>
> Reconnect restores only the repository you disconnected most recently. If you create a new repository, your app can't reconnect to the original repository.

**To reconnect your repository:**

1. Click the **GitHub** icon at the top-right and click **Connect to GitHub**.
2. In the **Reconnect Repository** dialog, click **Reconnect**.

> [!WARNING]
>
> **When you can't reconnect:**
>
> * Both your app and the repository have new commits since they last matched.
> * The repository was renamed or deleted, or its default branch changed.
> * The repository was connected from a different workspace.
> * The workspace's connection to the repository's organization was disconnected. Ask a workspace admin to reconnect it in **Workspace settings** > **GitHub**.
>
> In these cases, click **Create a new repository instead**.

### Disconnect an organization from your workspace

Disconnect a GitHub organization if you no longer want apps in your workspace to sync with it. Every app that syncs through the organization stops syncing, and the Base44 GitHub App stays installed on GitHub. Workspace owners, admins, and Editors can disconnect an organization.

**To disconnect an organization:**

1. Go to **Workspace settings**.
2. Click **GitHub**.
3. Under **Connected organizations**, click the **More actions** icon  next to the organization.
4. Click **Disconnect organization**.
5. Click **Disconnect** to confirm.


## Related topics

- [Base44 Developer Platform](https://docs.base44.com/developers/home.md)
- [Connecting GitHub to your app](https://docs.base44.com/Integrations/github-connector.md)
- [Billing, plans, and subscriptions](https://docs.base44.com/Account-and-billing/Billing-and-plans.md)
- [Connectors catalog](https://docs.base44.com/Integrations/connectors-catalog.md)
- [Base44 developer tools](https://docs.base44.com/documentation/building-your-app/developer-tools.md)


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