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

# GitHub

> Back up your Macaly project to GitHub and access your source code

Macaly's GitHub integration lets you back up your entire project to a private GitHub repository. You can push updates any time and restore from a backup when needed.

## What does GitHub integration do?

GitHub integration gives you:

* **External backups** of your project stored on GitHub
* **Version history** so you can see how your project changed over time
* **Source code access** so you can view, clone, or download your project's code from GitHub

It works as a backup and code access tool. You push your project to GitHub whenever you want a snapshot, and you can pull from that backup to restore it as a new project.

## How to set it up

<Steps>
  <Step title="Connect your GitHub account">
    Go to **Settings → General** and click **Connect GitHub**. You'll be redirected to GitHub to authorize the connection. Once approved, you're returned to Macaly.

    You only need to do this once.
  </Step>

  <Step title="Create a repository">
    Click **Create on GitHub** to create a new repository on GitHub and start syncing your code. Macaly creates a private repository and uploads all your project files. You'll see a link to the repository once it's done.
  </Step>

  <Step title="Push updates">
    After making changes in Macaly, click **Push changes** to send the latest version to GitHub. This creates a Pull Request in your repository. Go to GitHub to review and merge it.
  </Step>

  <Step title="Restore from GitHub">
    Click **Pull changes** to restore from your GitHub repository. This updates your **current project** — all files are replaced with the version from GitHub, while your environment variables (.env) remain unchanged.
  </Step>
</Steps>

## Can I download my project's code?

Yes. Once you push your project to GitHub, the full source code is available in your GitHub repository. You can:

* **View** the code directly on GitHub
* **Clone** the repository to your computer using Git
* **Download** it as a ZIP file from GitHub

## Can I export my project and host it somewhere else?

Yes, you can download your project's source code from GitHub once you've pushed a backup. However, Macaly projects are built to run on Macaly's hosting infrastructure, so running the code outside of Macaly may require additional setup.

## What gets backed up?

Your backup includes all project files, components, pages, styles, assets, and configuration. Environment variables and cache files are **not** included in the backup.

## Good to know

* **Pulling updates your current project** — all files are replaced with the GitHub version, but environment variables stay unchanged
* **Repositories are always private** — your code is not publicly visible on GitHub
* **Free GitHub account works** — you don't need a paid GitHub plan
* **You can disconnect GitHub** — use the disconnect option in Settings to unlink GitHub from your project at any time


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