# Put a project on GitHub

> Make an empty repository on GitHub, let the AirBuild GitHub App reach it, ask an Agent to push the project there, and work with branches and pull requests.

Source: https://air.build/docs/projects/put-a-project-on-github/

Every project in AirBuild already keeps its own Git history. To put it on GitHub, you make an empty repository there, let the AirBuild GitHub App reach it, and ask an Agent to push the project to it. The app has no button for the push: you ask in the project's chat.

Agents work on GitHub as the Team owner's GitHub account, through the AirBuild GitHub App. So the GitHub steps on this page are the Team owner's to do. If you're a member of someone else's Team, ask the owner. To bring a repository that's already on GitHub into AirBuild instead, see [Import a project from GitHub](https://air.build/docs/get-started/import-from-github/).

## Before you start

The Team's owner connects GitHub in Settings › [GitHub](https://air.build/docs/settings/github/). How, and how to choose the repositories Agents can reach, is in [Connect your GitHub account](https://air.build/docs/team/connect-github-account/).

## Make an empty repository on GitHub

On github.com, create a new repository:

- Make it where the Team owner's GitHub account can push: under that account, or in an organization where it has write access.
- Make it public or private. Both work, once the AirBuild GitHub App reaches the repository.
- Leave it empty: don't add a README, a `.gitignore` or a license. The project brings its own files and history.

Agents can't make the repository for you: the AirBuild GitHub App isn't allowed to create repositories on GitHub. So this step is yours.

## Let the AirBuild GitHub App reach it

Agents can push only to repositories shared with the AirBuild GitHub App. Share the new repository now, as in [Connect your GitHub account](https://air.build/docs/team/connect-github-account/#choose-which-repositories-agents-can-reach), or wait: when you ask an Agent to push, it asks for access in the chat. If the App was given all of an account's repositories, a new repository there is already shared.

## Ask an Agent to push the project

In the project's chat, give the repository's address:

```text
Push this project to https://github.com/example-org/example-app. It's a new, empty repository.
```

If the Agent can't reach the repository, it posts a **GitHub** card in the chat instead, for example "Needs access to the repository example-org/example-app. Grant it to the AirBuild app on GitHub."

1. The Team's owner taps **Grant Access**. If GitHub isn't connected yet, GitHub's sign-in opens first.
2. GitHub's page for the App opens. Add the repository there.
3. Come back to AirBuild. The card notices the change by itself and says "Access granted to example-org/example-app". If it still waits, tap **Grant Access** again. If the repository was already shared, tapping **Grant Access** settles the card at once.

The Agent then carries on. If it asks for a whole account ("Needs access to repositories on the example-org account. Install the AirBuild app on GitHub and choose which repositories to share."), install the App there the same way. If it asks you to pick ("Choose a GitHub repository to share."), see [Answer an Agent's questions and requests](https://air.build/docs/projects/answer-agent-requests/#share-a-github-repository).

When the Agent says it's done, open the repository on github.com to check. Commits Agents make show AirBuild as a co-author while **Sign Commits with AirBuild** is on. See [Connect your GitHub account](https://air.build/docs/team/connect-github-account/#sign-commits-with-airbuild).

GitHub has what the Agent pushed. For later work to reach GitHub too, ask an Agent to push again.

## Work with branches and pull requests

Once the project is on GitHub, you can ask for changes as a pull request:

```text
Make the login changes on a new branch and open a pull request for them.
```

```text
Push the current work to a branch called onboarding-v2, then open a pull request against main.
```

Agents have `git` and `gh`, GitHub's command-line tool, already signed in. See [gh and git in a Team](https://air.build/docs/cli/gh-git/). To keep track of pull requests, their checks and their approvals, add Gitta: see [Have an Agent watch your pull requests](https://air.build/docs/connect/track-pull-requests-with-an-agent/).

A repository's own rules on GitHub, such as a protected `main` branch, still apply to every push.

## Questions

**Can an Agent make the repository for me?**

No. The AirBuild GitHub App can work in repositories shared with it, but it isn't allowed to create new ones. Make the repository yourself on github.com, then share it with the App.

**The card says “Ask the owner to finish this step on GitHub.”**

You're a member of this Team, and its Agents use the owner's GitHub. Ask the Team's owner to tap **Grant Access** on the card.

**The card says “This organization uses single sign-on. Choose Grant Access again and complete single sign-on when GitHub asks.”**

Tap **Grant Access** again and complete single sign-on on GitHub. See [Connect your GitHub account](https://air.build/docs/team/connect-github-account/#single-sign-on).

**Access was granted, but the push is still refused**

Sharing the repository isn't the only thing GitHub checks. The Team owner's GitHub account itself needs write access to the repository. A protected branch or a ruleset can refuse a push, and so can a change to the workflow files under `.github/workflows` when the App isn't allowed to change them. Ask the Agent to check its access to the repository: the answer says which part is missing or, when access is in place, what else can refuse a push. See [gh and git in a Team](https://air.build/docs/cli/gh-git/#gh-access).

**My Team runs on a Mac and the Agent says git isn't installed**

On a Mac, Agents use the Mac's own `git`, such as the one that comes with Xcode. Install it on the Mac that runs the Team, then ask the Agent again.

**Is this the same as Share Project?**

No. **Share Project** publishes the project's source on an AirBuild page with its own link, without its Git history. Pushing to GitHub puts the project and its history in your own repository. See [Share or export a project's source](https://air.build/docs/projects/share-and-export-source/).
