Using HTTPS to Clone Code from CodeArts Repo to a Local Computer
Using Git Bash to Clone a Repo to a Local Host
- Access CodeArts Repo homepage.
- Go to the home page of the code repo to be cloned, click Clone/Download, and copy the HTTP address.
- On the local Git Bash client, run the cd D:/Repo command to go to the address of the code repository to be cloned. The following command indicates that the cloned code repository will be cloned to the Repo folder in drive D.
- Run the following command to clone the repository to the directory:
git clone code repo HTTPS link
If you clone code repo for the first time, you need to enter the username and password. There are two types of usernames and passwords. Select one of the following methods based on your configuration:
- To view the username and password, log in to and go to the Repo code repo list page, click the nickname in the upper right corner, and choose This Account Settings > Repo > HTTPS Password to obtain your username and password. If you have forgotten the password, you can reset the HTTPS password.
- Token username and password. The token username is private-token, and the token password is the configured token. If the token is lost or forgotten, generate a new token by referring to Configuring an Access Token.
If the following figure is displayed, the repo is cloned successfully. If code repo fails to be cloned, rectify the fault based on the description.
- When step 3 is executed, Git Bash reports error fatal: unable to access 'https:test.com/Test_Private.git/': SSL certificate problem: unable to get local issuer certificate. Before running the git clone command, run the following command so that Git does not verify the SSL certificate when cloning the code repository using HTTPS:
git config --global http.sslVerify false
- During the execution of step 3, Git Bash reports error fatal: unable to access 'https://test.com/Remote_Test.git/': Failed to connect to test.com port 443 after 21161 ms: Couldn't connect to server, indicating that the network is disconnected. Contact your local network administrator.
- When step 3 is executed, Git Bash reports error fatal: unable to access 'https://xxx.git/": Recy failure: Connection was reset, indicating that the domain name resolution is incorrect. For details about the solution, see FAQs.
- When step 3 is executed, Git Bash reports error fatal: destination path 'Test_Private' already exists and is not an empty directory., indicating that the Test_Private code repository has been cloned to this path and is not empty. Solution: Switch to a new empty directory and execute step 3 again.
- When step 3 is executed, Git Bash reports error fetal: Authentication failed for 'https:/xxx.git/', indicating that your password is incorrect. You can log in to the Repo code repo list page, click the nickname in the upper right corner, and choose This Account Settings > Repo >. HTTPS Password. Obtain your username and password. If you have forgotten the password, you can reset the HTTPS password.
- Error "The requested URL returned error: 401" Is Reported When HTTPS Is Used to Clone Code in CentOS This is because of the Git version dis-match.
- If you want to embed the access token into the HTTPS download link, run the following command in step 3: In the preceding command, password indicates your configured token. If the token is lost or forgotten, you can generate a new token by referring to Configuring an Access Token. {project_name} indicates the project name, and {repository_name} indicates the name of the code repository to be cloned.
git clone https://private-token:password@codehub.test.com/{project_name}/{repository_name}.git
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