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

# Pull code from a private Git repository

> See how to pull code from a private Git repository into your Upsun Cloud build process.

To complete its build, your Upsun Cloud project may need to access pieces of code stored in private Git repositories.
Examples include themes, libraries, and modules.
Configure these repositories to grant access to your project.

To grant access to a private Git repository,
add the project's public SSH key to your Git repository's deploy keys.

## 1. Get your project's public key

1. In the Console, open the project you want.
2. Click ** Settings**.
3. Under **Project settings**, click **Deploy key**.
4. Click ** Copy**.

![Deploy Key](https://mintcdn.com/upsun-c9761871/7cK3KMJBgO7MXm_y/images/management-console/settings-deploy-key.png?fit=max\&auto=format\&n=7cK3KMJBgO7MXm_y\&q=85\&s=fe92d72cfadf87d217b992020069d0bf)

## 2. Add the key to your repository in your Git provider

* [GitHub deploy key](https://docs.github.com/en/developers/overview/managing-deploy-keys#deploy-keys)
* [GitLab deploy key](https://docs.gitlab.com/ee/user/project/deploy_keys/#grant-project-access-to-a-public-deploy-key)
* [Bitbucket access key](https://support.atlassian.com/bitbucket-cloud/docs/configure-repository-settings/)

If you're only pulling code, the key doesn't need write permissions.

Now your Upsun Cloud project can access your private repository via SSH, including to add dependencies.

This means you can access the private repository through links like:
`git@<GIT_PROVIDER>:<PATH_OR_USERNAME>/<REPOSITORY>.git`.
For example, you can clone a repository in your [`build` hook](https://developer.upsun.com/docs/configure-apps/hooks):


&#x20;   applications:
&#x20;     \<APP\_NAME>:
&#x20;       hooks:
&#x20;         build: |
&#x20;           set -e
&#x20;           git clone git\@bitbucket.org:username/module.git

You can also use [private repositories as submodules](https://developer.upsun.com/docs/development/submodules.md#use-private-git-repositories).

## Using multiple private GitHub repositories

GitHub requires a separate deploy key for each repository.
To grant your project access to multiple repositories, create an automated user account, known as a machine user, with its own SSH key.

You can then add the machine account as collaborator to specific repositories
or to a team with access to the repositories.

See more information about [machine users on GitHub](https://docs.github.com/en/developers/overview/managing-deploy-keys#machine-users).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.