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

# GitHub Integration

> Connect ChatAndBuild with GitHub for seamless code management and deployment

## Overview

The GitHub integration allows you to sync code changes, and  push changes from ChatAndBuild. Connect your development workflow with the power of AI-assisted coding.

## Features

<CardGroup cols={2}>
  <Card title="Real-Time Sync" icon="arrows-rotate">
    Automatically sync changes between ChatAndBuild and your GitHub repositories.
  </Card>

  <Card title="Deployment Integration" icon="rocket">
    Push directly from the ChatAndBuild interface.
  </Card>
</CardGroup>

## Setting Up GitHub Integration

### Initial Connection

<Steps>
  <Step title="Navigate to Integrations">
    Go to Settings > Connect Apps > and click "Connect GitHub Account".
  </Step>

  <Step title="Authorize ChatAndBuild">
    You'll be redirected to GitHub to authorize the ChatAndBuild application.
  </Step>

  <Step title="Grant Permissions">
    Allow ChatAndBuild to access your repositories with the following permissions:

    * Read repository contents
    * Create and manage branches
    * Create pull requests
    * Access repository metadata
  </Step>

  <Step title="Verify Connection">
    Return to ChatAndBuild to confirm the integration is working.
  </Step>
</Steps>

## Commit Management

<Steps>
  <Step title="Stage Changes">
    Save all changes and push them to your new or existing repository.
  </Step>

  <Step title="Write Commit Message">
    Create descriptive commit messages following your team's conventions:

    ```
    feat: add user authentication system

    - Implement OAuth2 with GitHub
    - Add user profile management
    - Create protected route middleware

    ```
  </Step>

  <Step title="Push to GitHub">
    Push commits directly to your GitHub repository with one click.
  </Step>
</Steps>

## Troubleshooting

### Common Issues

<AccordionGroup>
  <Accordion title="Authentication Failed">
    **Problem**: Cannot connect to GitHub

    **Solutions**:

    * Re-authorize ChatAndBuild app
    * Check GitHub app permissions
    * Verify personal access token
    * Contact GitHub support if needed
  </Accordion>

  <Accordion title="Repository Not Syncing">
    **Problem**: Changes not appearing in GitHub

    **Solutions**:

    * Check repository permissions
    * Verify branch protection rules
    * Force manual sync
    * Review conflict resolution status
  </Accordion>
</AccordionGroup>

### FAQ

<AccordionGroup>
  <Accordion title="Repository Organization">
    <Icon icon="lightbulb" size={18} /> **Effective repo management**:

    * Use clear branch naming conventions
    * Keep repository structure consistent
    * Regular cleanup of merged branches
    * Maintain comprehensive README files
  </Accordion>

  <Accordion title="Security Practices">
    **Secure development**:

    * Never commit secrets or API keys
    * Use environment variables properly
    * Regular security audit of permissions
    * Enable two-factor authentication
  </Accordion>
</AccordionGroup>

<Note>
  Need help with other integrations? Check out our [Figma Integration](/docs/integrations/figma) and [Supabase Integration](/docs/integrations/supabase) guides.
</Note>
