<!-- llms-txt: https://hydron.app/llms.txt -->
<!-- llms-full-txt: https://hydron.app/llms-full.txt -->
<!-- canonical: https://hydron.app/docs/deploy-from-git -->

# Deploy from Git

Hydron supports deploying applications directly from Git repositories. You can connect via GitHub, GitLab, Bitbucket, or any publicly accessible Git URL.

## Supported Git providers

| Provider | Connection method |
|----------|------------------|
| **GitHub** | OAuth integration or public URL |
| **GitLab** | OAuth integration or public URL |
| **Bitbucket** | OAuth integration or public URL |
| **Any Git host** | Public repository URL |

## Connecting via OAuth

For private repositories, connect your Git provider account through OAuth. This gives Hydron secure, read-only access to your repositories.

1. In a new chat, click on your preferred provider (GitHub, GitLab, or Bitbucket)
2. You'll be redirected to authorize Hydron
3. Once connected, you'll see a list of your repositories
4. Select the repository you want to deploy

OAuth connections are stored securely and can be managed from your **Account Settings**.

## Connecting via public URL

For public repositories, you can paste the Git URL directly:

1. In a new chat, click **Public Git URL**
2. Enter the repository URL (e.g., `https://github.com/username/repo.git`)
3. Click **Analyze Repository**

Hydron clones the repository and begins the code analysis process.

## What happens during code analysis

After connecting your repository, Hydron's AI performs a comprehensive analysis:

![The chat interface showing code analysis in progress with AI messages](/images/docs/chat-interface.png)

The analysis detects:

- **Programming languages** and their versions
- **Frameworks** (Express, Django, Rails, Spring Boot, etc.)
- **Package managers** and dependencies
- **Services** within monorepos or multi-service projects
- **Existing Dockerfiles** and their quality
- **Environment variables** referenced in the code
- **Entry points** and build commands

## Reviewing analysis results

Analysis results appear both in the chat and in the **right sidebar** panel. For each detected service, you'll see:

- Service name and detected type
- Framework and language
- Dockerfile status (existing or needs generation)
- Required environment variables
- Port configuration

You can **accept** or **reject** individual services. Only accepted services will be included in the infrastructure plan.

## Selecting which services to deploy

For monorepo or multi-service projects, Hydron detects all deployable components. You choose which ones to include in the **Services** tab in the right sidebar.

![The Services panel showing detected services with accept/reject controls](/images/docs/sidebar-services.png)

Uncheck any services you don't want to deploy. The infrastructure plan will only include the selected services.

## Dockerfile handling

Hydron handles Dockerfiles in several ways:

- **Existing Dockerfile detected** — Hydron uses your existing Dockerfile as-is, or suggests improvements
- **No Dockerfile found** — The AI generates an optimized Dockerfile based on the detected framework
- **Multiple Dockerfiles** — For multi-service repos, each service gets its own Dockerfile

You can always edit the Dockerfile through the chat interface. Ask the AI to make changes like:
- "Add a multi-stage build to reduce image size"
- "Switch the base image to Alpine"
- "Add a build cache layer for dependencies"

## After analysis

Once you're satisfied with the analysis results:

1. Review and accept the detected services
2. Add any missing environment variables
3. The AI will offer to generate an infrastructure plan
4. Continue to [Infrastructure Plans](/docs/infrastructure-plans) to understand the next step

## Troubleshooting

**Analysis taking too long?**
Large repositories with many files may take longer to analyze. The AI prioritizes relevant files (source code, config files, Dockerfiles) and skips binary/media files.

**Wrong framework detected?**
Tell the AI in the chat: "This is actually a Next.js app, not a plain React app" — the AI will update its analysis.

**Missing services?**
Ask the AI to re-analyze specific directories: "Please also check the /services/auth directory for another service."

**Private repository access issues?**
Ensure your OAuth connection is active in Account Settings. For organization repos, you may need to grant Hydron access to the organization.
