Cette page n'est pas encore disponible dans votre langue. Nous nous efforçons d'ajouter d'autres langues. Nous vous remercions de votre compréhension.
- Service Overview
- Getting Started
-
User Guide
- Overview
- Git Installation and Configuration
- Setting SSH Key or HTTPS Password for CodeArts Repo Repository
- Migrating Data to CodeArts Repo
- Creating a CodeArts Repo Repository
- Associating the CodeArts Repo Repository
- Cloning or Downloading Code from CodeArts Repo to a Local PC
- Using CodeArts Repo
- Configuring CodeArts Repo
- Submitting Code to the CodeArts Repo
- More About Git
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs
- SSHKey
-
Repository
- Obtain files in the branch directory.
- Obtaining Warehouse Statistics
- Obtains image files of a specific branch in a repository.
- Modifying the Status of a Repository Referenced by a Pipeline
- Checks whether a user has the warehouse administrator permission.
- Sets whether a repository is in public or private state.
- Obtains the content of a specified file in a specified branch of a repository.
- Obtaining the List of Public Sample Templates
- Creating a repository
- Obtain the short ID of the repository based on the repository name and group name to combine the short ID with the URL of the submission details page corresponding to commitid.
- Queries the submission of a branch of a repository based on the group name and repository name.
- Querying the Branch of a Warehouse
- This API is used to query the submission of a branch of a warehouse based on the warehouse ID. More optional parameters are provided.
- Adding a Deployment Key
- Deleting a Repository Deployment Key
- Obtains the last submission statistics of the warehouse.
- Repository Statistics
- Delete repositories
- Check the repository creation status.
- Querying the Tag List of a Warehouse
- Adding a Tag
- Querying the Details of a Warehouse
- Obtains the number of submitted code lines.
- Download Repository
- Creating a Protection Branch
- Obtaining the Repository Branch List
- Obtaining the List of Warehouse Combination Requests
- Obtaining Warehouse Combination Request Details
- V2Project
- RepoMember
- Commit
- File
- User
- WebHook
- Project
- V2 Warehouse Management
- Discussion
- Application Examples
- Appendix
-
FAQs
-
Managing Repositories
- How Can I Set Multiple SSH Keys on My Computer?
- How Can I Prevent Unauthorized Code Replication?
- How Do I Upgrade TLS?
- Should I Set a Public SSH Key for Each Repository?
- Can All Users Upload and Download Code with the Same SSH Key?
- Will the System Remove Deleted Project Members from Repositories and SSH Keys Created by Them?
- How Can I Make a Repository Private or Public?
- SSH Function Upgraded
- Using Repositories
- Migrating Repositories
-
FAQs
- Why Can't I View Repositories Created by Other Project Members?
- Is There Any File Size Limit in Repositories?
- Can I Export the Statistics on Code Lines Committed by Members?
- How Do I Prevent Files Containing Secrets from Being Pushed to a Repository?
- Why Can't I See the Repository Synchronization Tab?
- Will Related Git Code Branches Be Automatically Deleted When the Creator of a Git Branch Is Deleted?
- What Do I Do If a Binary File Fails to Be Pushed to CodeArts Repo?
-
Git Issues
- How Does Git Identify Repository Administrators?
- How Do I Obtain the Path Where Downloaded Code Is Stored?
- How Do I Obtain the Code Repository Address?
- What Are Repository URLs Used for?
- Does CodeArts Repo Support SVN?
- Can I Decompress a Compressed Package Uploaded to a Cloud Repository?
- How Do I Clear, Save, and Change the Username and Password in Git?
-
Troubleshooting
- Private Key Is Lost
- SSH Key Already Exits
- Git Keeps Asking for Passphrase During Code Clone via SSH
- Password Incorrect During Code Clone via HTTPS
- Committed Files Cannot Be Found in the Cloud Repository
- Message "pathspec XXX did not match any files" Is Displayed
- Message "Transport Error: cannot get remote repository refs. XXX.git: cannot open git-upload-pack" Is Displayed
- Message "syntax error near unexpected token `newline'" Is Displayed
- Message "unable to auto-detect email address" Is Displayed
- Message "fatal:Authentication failed" Is Displayed
- Message "'origin' does not appear to be a git repository" Is Displayed
- Message "You are not allowed to push code to protected branches on this project" is Displayed
- Message "Not a git repository" Is Displayed
- Message "src refspec master does not match any" Is Displayed
- Message "destination path 'XXX' already exists and is not an empty directory" Is Displayed
- Message "The requested URL returned error: 401" Is Displayed
- Code Push Fails
- Code Pull Fails
- Message "fatal: refusing to merge unrelated histories" Is Displayed
- Message "SSL certificate problem" Is Displayed
-
Managing Repositories
Using SSH to Clone Code from CodeArts Repo to a Local PC
Prerequisites
Your network can access CodeArts Repo. For details, see Network Connectivity Verification.
Cloning Code on the Git Bash Client Using SSH
This section describes how to use the Git Bash client to clone a repository of CodeArts Repo to a local PC.
- Download and install the Git Bash client.
- Configure an SSH key.
- Obtain the repository address. (If there is no repository, create one.)
On the repository details page, click Clone/Download to obtain the SSH address. You can use this address to connect to CodeArts Repo from the local PC.
NOTE:
If no SSH key is available, click SSH Keys to configure one. For details, see SSH key.
You can obtain the SSH address from URL in the repository list of CodeArts Repo.
- Open the Git Bash client.
Create a folder on the local PC to store the code repository. Right-click the blank area in the folder and open the Git Bash client.
NOTE:
The repository is automatically initialized during clone. You do not need to run the init command.
- Run the following command to clone code from CodeArts Repo:
git clone <repository_address>
repository_address in the command is the SSH address obtained in 3.
If you clone the repository for the first time, the system asks you whether to trust the remote repository. Enter yes.
After the command is executed, a folder with the same name as CodeArts Repo is displayed, and a hidden .git folder exists in the folder, indicating that 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 CodeArts Repo.
Run the following command on the Git client to test the network connectivity:
ssh -vT git@**********.com
If the returned information contains Could not resolve hostname code**********.com: Name or service not known as shown in the following figure, your network is restricted and you cannot access CodeArts Repo. In this case, contact your local network administrator.
- Check the SSH key. If necessary, regenerate a key and configure it on the CodeArts Repo console.
- Only PCs that enabled the IP address whitelist can be cloned on the Git client.
Cloning Code on the TortoiseGit Client Using SSH
This section describes how to use the TortoiseGit client to clone a repository of CodeArts Repo to a local PC.
- Download and install the TortoiseGit client.
- Obtain the repository address. (If there is no repository, create one.)
On the repository details page, click Clone/Download to obtain the SSH address. You can use this address to connect to CodeArts Repo from the local PC.
NOTE:
You can obtain the SSH address from URL in the repository list of CodeArts Repo.
- Go to the local 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, select Load Putty Key, choose the private key file, and click OK.
- Click OK to start cloning the repository. If you clone the repository for the first time, the TortoiseGit client asks you whether to trust the remote repository. Click Yes.
- The cloning duration is affected by the repository size. The following figure shows the cloning process.
Cloning a Repository on Linux or macOS Using SSH
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 SSH.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.