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

# Adding a new Git Repository to your project using Personal Access Token (PAT)

#### **Version/Environment (if relevant):**

Domino Versions 5.x and later

## **What:**

Connecting a new Git repository to projects using a Personal Access Token (PAT) generated from any Git service account.

## **How:**

To link a Git repository to your Domino project using a Personal Access Token (PAT), follow these steps:

## Creating credentials

If you are adding a private repository, want to write commits to remote, or are using SSH, you will need to add Git credentials to your Domino account. Domino will use these credentials to authenticate with the service hosting your repository when you start a [run](https://docs.dominodatalab.com/en/latest/user_guide/af97b7/create-and-run-jobs/).

### Personal Access Token creation

You will need a personal access token to access a private repository via HTTPS. You will need a personal access token if the URI you want to use to interact with a repository is formatted as:

`https://<domain>/<user>/<repository>.git`

Personal Access Tokens are supported by the following Git services.

* [GitHub Personal Access Tokens](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
* [GitLab Personal Access Tokens](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html)

The personal access token you generate needs to have read and write access to your private repositories.

To generate a personal access token in your **GitHub**

1. Navigate to your Git account settings, then Developer Settings. Click the Personal access tokens menu, then click Generate new token.
2. Select repo as the scope. The token will be applicable for all the specified actions in your repositories.
3. Click Generate Token.

To generate a personal access token in your **GitLab**

1. From your home page, open your user settings, and then select Personal access tokens.
2. And then select + New Token.
3. Name your token, select the organization where you want to use the token, and then choose a lifespan for your token.
4. Select the scopes for this token to authorize for your specific tasks.

After generating a personal access token in your Git service, use these steps to add it to Domino:

1. In Domino, click your username in the upper right, then click **Account Settings**.
2. Scroll down to the panel labeled *Git Credentials*, then click **Add a New Credential**.
3. In the *Domain field*, enter the exact domain of the service hosting your repositories, such as github.com, **gitlab.com**, or **your-internal-gitlab-url.com**.
4. For *Authentication Credential Type*, click to select **Personal Access Token**.
5. Enter your personal access token, then click **Add Credential**.
6. You should now see your credential listed in the Git *Credentials* panel. You can also delete it from this panel if desired.

## [Add a repository to a project.](https://docs.dominodatalab.com/en/latest/user_guide/314004/import-git-repositories/)

1. Open the project you want to add a repository to, then click **Files** from the left navigation bar.
2. Click to open the **Git Repositories** tab, then click **Add a New Repository**.
3. Enter an optional directory name and the HTTPS or SSH URI of the repository you want to add. The directory name will be the directory in that `/repos` this repository clones into. It defaults to the name of the repository.
4. Use the dropdown menu to choose which branch of the repository you want Domino to check out when it clones this repository into a run or workspace. If you leave this setting at *Use default branch*, Domino will check out the branch specified as default by your Git service, typically `master`. You can also specify a different branch name, tag name, or commit ID, or supply a custom Git ref.
5. Click **Add Repository**.

**You're All Set!**

## **Notes/Information:**

### **References/Internal Records:**

[https://docs.dominodatalab.com/en/latest/user\_guide/314004/import-git-repositories/](https://docs.dominodatalab.com/en/latest/user_guide/314004/import-git-repositories/)


## Related topics

- [How-to guides](/knowledge-base/how-to-guides-overview.md)
- [Create Projects](/cloud/platform-capabilities/core-concepts/projects/create-projects.md)
- [Link a GitHub account to Domino](/cloud/platform-capabilities/core-concepts/workspaces/link-github-account-to-domino.md)
- [Reuse your coding agent subscription across workspaces](/cloud/platform-capabilities/features/coding-assistants/reuse-credentials.md)
