---
schema_version: "1"
id: f8ecc2b228ffe986af9c9e4f6e908dcf8a5aa8812f2c4ac8f0c2ce900222beba
title: Add Project to Source Control
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/codebuilder/guides/files/source-control/codebuilder-add-project-source-control.md
canonical_url: https://developer.salesforce.com/docs/platform/code-builder/guide/codebuilder-add-project-source-control.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7a1b368c7e272e5a5c3256e573f383194e4da8b0a8504f6c1827dea5ca567675
products:
  - Agentforce Vibes IDE
  - salesforcedx
---
# Add Project to Source Control

The Activity Bar enables you to initialize a repository from a project and publish the repository to GitHub. Alternatively, Open the Command Palette (⇧⌘P) and search for "git" to view git commands.

**note:** You must have a GitHub account as a prerequisite to adding a project to a GitHub repo.

To add a project to a GitHub repo:

1. Click the Source Control icon (![Source Control icon](https://developer.salesforce.com/media/codebuilder/icon_source_control.png)) in the Activity Bar.
2. Click **Initialize Repository**.
3. In the Message field, add a commit message, such as "initialize project repo".
4. Click **Commit**.
5. Click **Yes** in the window asking "Would you like to stage all your changes and commit them directly?"
6. Click **Open Git Log** in the window that says "Make sure you configure your "user.name" and "user.email" in git."
7. Click the Terminal subtab and run the following commands after you substitute values for _you@example.com_ and _Your Name_:

```text
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
```

8. In the Activity Bar, enter the commit message again and click **Commit**.
9. Click **Publish Branch**.
10. Click **Allow** in the window that says "The extension 'GitHub' wants to sign in using GitHub."
11. Click **Copy & Continue to GitHub**.
12. Click Open to open GitHub in your browser.
13. Paste the copied code and click **Continue**.
14. If prompted for Single sign-on to your organizations, click **Continue**.
15. If prompted, click **Authorize Visual-Studio-Code**.
16. Complete logging in to GitHub. If two-factor authentication is configured for your GitHub account, you may be asked for a two-factor code.
17. In Agentforce Vibes IDE, choose to "Publish to GitHub private repository". Alternatively, choose "Publish to GitHub public repository" if you want to make the repo available to anyone. If in doubt, choose the private repo.

Your project is now saved in GitHub.
