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

# Contribute code

> Connect GitHub or GitLab, improve an existing app with Replit, and propose your changes for review.

You have seen how connected tools give Replit more context. You can also connect
GitHub or GitLab and contribute to code stored there.

Ask Replit to explain how an app works, fix a problem, or add a feature. Preview
and test the result, then push your contribution back to GitHub or GitLab for
review.

This is an optional path in the coffee-shop journey. If you already have a café
website, you could improve it rather than build a new one. If you are starting
from scratch, you can [continue to the weekly market watch](https://docs.replit.com/home/watch-the-competition.md)
and create an opening site later.

> [!NOTE]
>
> Repository-based development is in early access, and availability can differ
> by workspace. You need authorized access to the repository you want to use.

## From an idea to a code contribution

The screenshots below come from the Code guides. The change shown is a demo
website heading, rather than the café's opening hours.

**1. Connect your repository**

Open [Repositories](https://replit.com/repos), connect GitHub or GitLab,
and choose a repository you can access. Select **Use in chat** to begin
working with it.

A repository is where your app's code and its history are stored. Connecting
it lets you work on that code without moving your live app to Replit.

Follow [Connect to your repository](https://docs.replit.com/build/code/connect-your-repository.md)
for the full setup.

![Repositories page with GitHub and GitLab controls and Use in chat actions](https://mintcdn.com/replit/ZvLiuMLrojYoqf3I/images/code-contributions/repositories.jpg?fit=max\&auto=format\&n=ZvLiuMLrojYoqf3I\&q=85\&s=41ee70068611fc2d6446099be29982f1)

**2. Run the app and describe your change**

Ask Replit to run the app in a development preview, then describe the result
you want. For an existing café website, you could start with:

Help me update the opening hours on this website. Find where they are
defined, ask me for the new hours, and show me the updated preview.

You can also start with a question about how the code works, without
requesting any changes.

See [Run your app in Replit](https://docs.replit.com/build/code/run-your-first-preview.md) for
preview and setup guidance.

![A request to change a demo website heading beside the updated development preview](https://mintcdn.com/replit/ZvLiuMLrojYoqf3I/images/code-contributions/contribution-result.jpg?fit=max\&auto=format\&n=ZvLiuMLrojYoqf3I\&q=85\&s=f0f07232da0695764b98a84000a0eeae)

**3. Review and test**

Check the preview and ask Replit to test the change. For the café website,
confirm that the new hours are correct and readable on both desktop and
mobile.

A development preview is separate from your live site. Review what changed
and any test failures before proposing the contribution.

**4. Contribute back to GitHub or GitLab**

When you are happy with the result, ask Replit to push the changes to a
new branch and open a **pull request** on GitHub, or a **merge request**
on GitLab.

Push these changes to a new branch in my repository and open a request
for review. Summarize what changed and how it was tested.

This proposes your changes for your team to review. It does not merge them
or update your live site. You can ask Replit to address review feedback
in the same chat.

![Replit showing a draft pull request and the proposed heading change in the Changes pane](https://mintcdn.com/replit/ZvLiuMLrojYoqf3I/images/code-contributions/push-result.jpg?fit=max\&auto=format\&n=ZvLiuMLrojYoqf3I\&q=85\&s=628442b1340c4cea26814d92b903fed9)

Follow [Make a contribution](https://docs.replit.com/build/code/first-contribution.md) and
[Respond to review](https://docs.replit.com/build/code/respond-to-review-feedback.md) for the
complete workflow.

## Explore what else you can do

Code contributions can range from fixing a label to developing a feature.
The [Code overview](https://docs.replit.com/build/code/code-with-replit.md) explains how to explore a
codebase, investigate bugs, and work with your team's existing review process.

## Next

Continue the coffee-shop journey:
[Watch the competition](https://docs.replit.com/home/watch-the-competition.md) with a weekly Routine.
