Using the SSH Key to Clone a Repo to a Local PC
Using Git Bash to Clone a Repo to a Local Host
The SSH key is a secure identity authentication method used to access a remote server. Using an SSH key to clone a code repository avoids the username and password each time for higher efficiency of cloning a code repository.
- Access CodeArts Repo homepage.
- Go to the repo homepage of the code to be cloned, create a personal branch, click Clone/Download, and copy the SSH address.
- On the local Git Bash client, run the following command to access the address of the code repository to be cloned. This command indicates that the cloned code repository will be cloned to the Repo folder in drive D. You can change the address as needed.
cd D:/Repo
- Run the following command to clone the repository to the directory:
SSH address of git clone code repo
If you clone the repository for the first time, the system asks you whether to trust the remote repository. Enter yes.
If the following figure is displayed, the repo is cloned successfully.
If Git Bash reports error git@test.com: Permission denied.fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists. in step 3, the SSH key for accessing Repo has not been configured. Configure the SSH key first. For details, see Configuring an SSH Private Key.
Use the SSH key to clone the code repo to the local host in TortoiseGit.
- Access CodeArts Repo homepage.
- Go to the home page of the code repo to be cloned, click Clone/Download, and copy the SSH address.
- Go to the local directory where you want to clone the repository, and choose Git Clone... from the right-click menu.
- In the displayed dialog box, paste the SSH address copied in step 2 to the URL text box, select Load PuTTY key, and select the private key file generated during TortoiseGit installation.
- Click OK. If you clone the code repository on the TortoiseGit client for the first time, the system asks you whether to trust the remote repository. Click Yes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot