There was a problem loading the comments.

Cloning a private repository in cPanel

Support Portal  »  Knowledge base  »  Viewing Article

  Print

Clone a private repository in cPanel

To clone a private repository in cPanel we can do it only through SSH, using a public key, since it does not allow authentication through username:password in an HTTPS URL in its interface.

To clone a repository via SSH, we will need a public key generated on our server, for this, you can follow this guide: https://www.factoriadigital.com/soporte/es/tutoriales-y-preguntas-frecuentes/article/generar-importar-clave-ssh-desde-cpanel-consola
Once we have the public SSH key, we can add it to our GitHub account, Bitbucket or the version control system we are using, to provide access to our server to our repository.

Import SSH key in Bitbucket

We access the private repository in Bitbucket and on the left side menu, click on"Settings":

78d6b7b29a6a996d5a14a532e8c2c14ecf34dc4f?t=72e390353e279854d80b8a3be52c8688
Once inside, if we have the necessary permissions in the repository, we will see the menu section "Access keys", we access and click on "Add Key":


e784ec163adacf64d6bd747e945525bdca6a3bb8?t=58eca6663893f5e92f5601de2e929145
We will see the following form, where we must enter an identifying name for our key and the public key copied as it is in the box below:

13fa5e11d314301465126ef37ebb80e42d4aaf9d?t=1153508763263a39a830c1bb6440b9f3
After this, click on "Add key" and we will have the key imported for the repository in Bitbucket
.

Import SSH key in GitHub

To import the SSH key in Github, you can consult the following documentation: https://help.github.com/es/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account

Clone repository

Go to"Git Version Control" and click on"Create". A form will appear, where to enter the data of the private repository that we are going to clone, for it we will need the URL that usually gives us GitHub or Bitbucket in the buttons of"Clone", inside the own repository or the same URL of the repository.
In this case, as we want to clone a directory via SSH, we will need the URL highlighted in the orange box:

90142240101f873d5b52cee9409afa32f5f727ac?t=34e909d8d630ab9e7411fa2ae873df4a
We will copy that URL into the"Clone URL" field and leave the rest as default. If we need it to be installed in another directory, we can change it in the"Repository Path" field, note that the directory cannot exist:

b2805701b1031c3fc6a719be955f3d50eb8d27e5?t=fd98867af4eb4486e4817a1e999f9b2a
After filling in the fields, click on"Create". If we have added the SSH key correctly, we will get a confirmation message and we will have successfully cloned our private repository via SSH:

a50d68736069668893d44c82342831a4f311831c?t=43ef7df7bcba073ea08424e163a79082

Next steps

We leave you a guide to help you to configure the deploys and manage GIT from cPanel: https://www.factoriadigital.com/soporte/es/tutoriales-y-preguntas-frecuentes/article/gestionar-git-desde-cpanel

Si todavía tienes dudas, contacta con nosotros y te ayudamos.


Share via
Did you find this article useful?  

Related Articles


Comments

Add Comment

Replying to  


Self-Hosted Help Desk Software by SupportPal
© FactoriaDigital.com