# How can I clone a private repository as part of my deploy commands within the Okteto manifest?

**URL:** <https://community.okteto.com/t/how-can-i-clone-a-private-repository-as-part-of-my-deploy-commands-within-the-okteto-manifest/1133>\
**Category:** How Do I?\
**Created:** [November 30, 2023, 10:00am UTC](https://community.okteto.com/t/how-can-i-clone-a-private-repository-as-part-of-my-deploy-commands-within-the-okteto-manifest/1133 "2023-11-30T10:00:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nacho](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/nacho/32/20_2.png) [@nacho](https://community.okteto.com/u/nacho)\
**Post date:** [November 30, 2023, 10:00am UTC](https://community.okteto.com/t/how-can-i-clone-a-private-repository-as-part-of-my-deploy-commands-within-the-okteto-manifest/1133/1 "2023-11-30T10:00:31Z")

</div>

Hi!

I have an Okteto manifest where I need to clone a private repository as part of the deploy commands, something like this:

```yaml
deploy:
  commands:
  - name: "Clone private repository"
    command: git clone git@github.com:my-user/my-private-repo.git
....

```

When I execute this manifest locally, it works because it is using my local ssh key, but when I deploy the repository from the UI I’m getting the following error:

`git@github.com: Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists`

I tried configuring the GitHub App giving access to the repository, but that only works If I deploy directly that repository from the UI, but it doesn’t work If I want to clone it as part of other’s repository manifest.

How can I make it work?

---

<div class="post-metadata">

**Author:** ![pchico83](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/pchico83/32/25_2.png) [@pchico83](https://community.okteto.com/u/pchico83)\
**Post date:** [November 30, 2023, 10:23am UTC](https://community.okteto.com/t/how-can-i-clone-a-private-repository-as-part-of-my-deploy-commands-within-the-okteto-manifest/1133/2 "2023-11-30T10:23:45Z")

</div>

When deploying a git repository from the Okteto UI, a job is created in the cluster. The git repository is cloned into this pod, and then the deploy commands are executed. When cloning the main git repository, Okteto utilizes both the [GitHub App](https://www.okteto.com/docs/administration/private-repositories/github-app) (if configured) and the cluster [SSH Key](https://www.okteto.com/docs/administration/private-repositories/ssh-key/).

The SSH Key is mounted in the pod, allowing you to use it to clone other git repositories as part of your deploy commands. Conversely, the GitHub App cannot be employed for this purpose. In summary, if you need to clone a private git repository as part of your deploy commands, it is essential to configure the [SSH Key](https://www.okteto.com/docs/administration/private-repositories/ssh-key/) of the cluster in your private git repository and grant access to it.
