Skip to main content
Push your Kleap app code to GitHub for version control, backup, and code ownership.

Why GitHub?

  • Version control - Track every change with Git
  • Backup - Code stored safely in the cloud
  • Collaboration - Work with developers
  • Two-way sync - Changes flow both directions automatically
  • Portability - Own and take your Astro source code anywhere
GitHub is for backup, code ownership, and two-way sync — it is not how your site goes live. Kleap deploys your app automatically to Kleap’s global edge at {your-app}.kleap.io whenever you publish. Pushing to GitHub does not deploy anything.

Connecting GitHub

One-Time Setup

  1. Go to Settings > GitHub
  2. Click Connect GitHub
  3. Authorize Kleap in the popup
  4. Select repositories access

Permissions Requested

  • Read your profile
  • Create repositories
  • Push to repositories
  • Read repository contents
We only access repositories you explicitly connect. Your other repos remain private.

Pushing Code to GitHub

Create New Repository

  1. Open your app
  2. Go to Settings > GitHub
  3. Click Create Repository
  4. Enter repository name
  5. Choose public or private
  6. Click Create & Push

Connect Existing Repository

  1. Open your app
  2. Go to Settings > GitHub
  3. Click Connect Repository
  4. Select from your repositories
  5. Confirm connection
Connecting to an existing repo will overwrite its contents. Make sure it’s empty or a backup exists.

Syncing Changes

Sync works in both directions: push to GitHub and Kleap syncs the changes in, and changes made in Kleap are pushed back to GitHub. A last-commit-sha guard prevents sync loops between the two sides.

Push to GitHub

After making changes in Kleap:
  1. Go to Settings > GitHub
  2. Click Push Changes
  3. Enter a commit message (optional)
  4. Changes are pushed to your repo

Auto-Push

Enable automatic syncing:
  1. Go to Settings > GitHub
  2. Toggle Auto-push on publish
  3. Every publish also pushes to GitHub

Repository Structure

Your GitHub repo contains the full Astro project — an Astro 5 static site with Tailwind v4, React 19 islands, and TypeScript:

Working with Developers

Share with a Developer

  1. Push your code to GitHub
  2. Share the repository URL
  3. Developer clones and runs locally:

Merge Developer Changes

When a developer pushes changes:
  1. Go to Settings > GitHub
  2. Click Pull Changes
  3. Changes are synced to Kleap
Manual merges may be needed if both sides have changes. Advanced Git knowledge helps here.

Branches

Default Branch

Kleap works with your default branch (usually main or master).

Feature Branches

For experimental changes:
  1. Developer creates branch locally
  2. Makes changes and commits
  3. Creates pull request
  4. Merge to main when ready
  5. Pull changes into Kleap

GitHub Actions

Your repository can use GitHub Actions for:
  • Automated testing - Run tests on push
  • Code quality - Lint and format checks
  • Build checks - Verify the Astro build passes
GitHub Actions run inside GitHub only. They don’t publish your Kleap site — deployment stays automatic through Kleap (to Kleap’s global edge at {your-app}.kleap.io).

Example Workflow

Private vs Public

TypeVisibilityUse Case
PrivateOnly you and collaboratorsClient projects, proprietary code
PublicAnyone can viewOpen source, portfolios

Disconnecting GitHub

To disconnect:
  1. Go to Settings > GitHub
  2. Click Disconnect
Your repository remains on GitHub. Only the Kleap connection is removed.

Troubleshooting

  • Check your GitHub connection is active
  • Ensure you have write access to the repo
  • Try disconnecting and reconnecting
  • Pull changes before pushing
  • Resolve conflicts manually if needed
  • Consider using a developer for complex merges
  • Ensure you granted access during OAuth
  • Go to GitHub settings and update Kleap’s permissions
  • Try reconnecting your account
  • GitHub has a 100MB file limit
  • Use Git LFS for large assets
  • Consider using a CDN for large images/videos

Best Practices

Push regularly

Don’t wait too long between pushes. Regular backups are safer.

Write good commits

Describe what changed in commit messages for future reference.

Use private repos

Keep client work and proprietary code in private repositories.

Review before merge

Always review developer changes before pulling into Kleap.

Version History

Use Kleap’s built-in version history alongside GitHub