Using HTTPS to Clone a Cloud Repository to a Local Computer
Cloning Code on the Git Bash Client Using HTTPS
This section describes how to use the Git Bash client to clone a cloud repository of CodeHub to a local computer.
The maximum size of a package that can be pushed at a time using HTTPS is 500 MB. If the size is greater than 500 MB, use the SSH mode.
- Download and install the Git Bash client.
- Configure an HTTPS password.
- On the CodeHub homepage, click the name of a repository in the repository list. On the repository details page displayed, click Clone/Download, click Clone with HTTPS, and copy the repository address.
- Open Git Bash, navigate to the directory where you want to clone the repository, and run the following command. For the first clone, enter the username (account name/username) and HTTPS password.
git clone HTTP_download_address
If the clone fails and the message SSL certificate problem is displayed, run the following command:
git config --global http.sslVerify false
- After the username (account name/username) and HTTPS password are entered, the repository is cloned.
- Run the following command to go to the repository directory:
cd <repository_name>
You will be taken to the master branch by default.
If the git clone command fails to be executed, locate the fault as follows:
- Check whether your network can access CodeHub.
Run the following command on the Git client to test the network connectivity:
ssh -vT git@code**********.com
The command output contains Could not resolve hostname code**********.com: Name or service not known, as shown in the following figure.
- Check the SSH key. If necessary, regenerate a key and configure it on the CodeHub console.
- Only PCs that enabled the IP address whitelist can be cloned on the Git client.
Cloning Code on the TortoiseGit Client Using HTTPS
This section describes how to use the TortoiseGit client to clone a cloud repository of CodeHub to a local computer.
- Download and install the TortoiseGit client.
- Configure an HTTPS password.
- On the CodeHub homepage, click the name of a repository in the repository list. On the repository details page displayed, click Clone/Download, click Clone with HTTPS, and copy the repository address.
- Go to the directory where you want to clone the repository, and choose Git Clone... from the right-click menu.
- In the dialog box displayed, paste the copied repository address to the URL field and click OK.
- If you clone a repository on TortoiseGit for the first time, enter the username and HTTPS password as prompted.
- Wait until the clone is complete.
Cloning a Repository on Linux or macOS Using HTTPS
After the environment is configured (see Installing Git for Linux or Installing Git for macOS), the clone operations of the Git client on Linux or macOS are the same as those in Cloning Code on the Git Bash Client Using HTTPS.
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