このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。
- What's New
- Function Overview
- Product Bulletin
- Service Overview
- Getting Started
-
User Guide
- Process of CodeArts Repo
- Purchasing CodeArts
- Accessing CodeArts Repo Homepage
- Environment and Personal Settings
- Migrating Code and Syncing a Repository
- Creating a Repository
- Viewing Activities
- Viewing Repository Statistics
- Configuring Repository Settings
- Hierarchical Repository Management
- Configuring a Repository
- Managing Repo Member Permissions
- Cloning or Downloading Code Repo to a Local PC
- Uploading Code Files to CodeArts Repo
- Developing a Workflow
- Creating and Configuring a CodeArts Project
- Committing Code to CodeArts Repo and Creating a Merge Request
- Managing Merge Requests
- Managing Code Files
- Security Management
- Best Practices
-
FAQs
- Authentication
- Member Permissions
-
Uploading and Downloading Code
- "Error: Deny by project hooks setting 'default': message of commit" Is Reported When Code Repository Is Pushed from the Local Host to CodeArts Repo
- Pushing Binary Files to CodeArts Repo Failed
- Error "'origin' does not appear to be a git repository..." Is Reported When the Git Push Command Is Executed
- Error "The requested URL returned error: 401" Is Reported When HTTPS Is Used to Clone Code in CentOS
- Error "Merge branch 'master' of https://test.com Please Enter a commit" Is Reported When Pulling Code Using the Git Pull Command
- Message "fatal: refusing to merge unrelated histories" Is Displayed
- How Do I Prevent Files Containing Secrets from Being Pushed to CodeArts Repo?
- Migrating Repositories
- Merge Request
- Fork Sync
- Repository Capacity
- FAQs
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs
- SSH Key
-
Repository
- Obtaining Files in a Branch Directory
- Obtaining Repository Statistics
- Obtaining Image Files of a Specific Branch in a Repository
- Modifying the Status of a Repository Referenced by a Pipeline
- Checking Whether a User Has the Repository Administrator Permission
- Setting a Repository to Public or Private
- Obtaining the Content of a Specified File in a Specified Branch of a Repository
- Obtaining a Public Template List
- Creating a Repository
- Obtaining a Repository Short ID to Generate the Details Page URL
- Querying a Commit of a Branch by Repository or Repository Group Name
- Querying Branches of a Specified Repository
- Querying a Commit of a Repository Branch by the Repository ID
- Adding a Deploy Key
- Deleting a Deploy Key
- Obtaining the Last Commit Statistics of a Repository
- Repository Statistics
- Deleting a Repository
- Viewing a Repository Creation Status
- Querying the Tag List of a Repository
- Adding a Tag
- Querying Details About a Repository
- Obtaining the number of committed code lines
- Downloading a Repository
- Creating a Protected Branch
- Deleting a Protected Branch
- Deleting Protected Branches in Batches
- Creating a Protected Tag
- Deleting a Protected Tag
- Obtaining a Repository Branch List
- Obtaining the MR List of a Repository
- Obtaining MR Details of a Repository
- Obtaining the Repository IP Address Whitelist
- Adding the Repository IP Address Whitelist
- Modifying the Repository IP Address Whitelist
- Deleting the Repository IP Address Whitelist
- Obtaining the Changes of an MR
- Associating a Repository with a Member Group
- Locking a Repository Based on the Repository Short ID
- Unlocking a Repository Based on the Repository Short ID
- Approving an MR
- Obtaining Associated Work Item Information
- Obtaining Reviewer Information Based on the Repo Short ID and Merge Request Short ID
- Obtaining the List of Changed Files
- Tenant
- Group
- Project (V2)
- RepoMember
- Commit
- File
- User
- Webhook
- Project
- Repository Management (V2)
- Review
- Application Examples
- Appendix
- Videos
- General Reference
Copied.
Committing Code in Eclipse and Creating a Merge Request
If EGit is installed on your local Eclipse, you can commit the local Git repository code to CodeArts Repo. CodeArts Repo supports only Eclipse 4.4 and later versions.
- For the first push:
- Create a repository on the local computer, that is, the local repository.
- Commit the update to the local repository.
- Pull the code from the server to the local repository, merge the code, and push the repository to the server. After remote commit is complete.
- If it is not the first push:
- Commit the modified code to the local repository.
- Pull the code from the server to the local repository, merge the code, and push the repository to the server.
Step 1: Installing EGit on Eclipse
Perform the following steps to install Eclipse 4.4:
On the Eclipse toolbar, choose Help > Install New Software.... In the Install window that is displayed, click Add..., enter EGit in Name and EGit plug-in address in Location, click OK, and click Next > until the installation is complete. After the installation is complete, restart Eclipse.
Step 2: Configuring EGit on Eclipse
- On the Eclipse toolbar, choose Window > Preferences > Team > Git > Configuration and enter the User Settings information.
- Click OK.
email indicates the bound email address. If the username is not set previously, set it in this step.
Step 3: Creating a Project and Committing Code to the Local Git Repository
- Create the git_demo project and the HelloWorld.java class.
- Share the git_demo project with the local repository.
- In the Share Project window displayed, select Git.
- Click Next >. In the Configure Git Repository dialog box, select Use or create repository in parent folder of project and click Create Repository.
- Click Create Repository to create a Git repository.
The directory is in the untracked status, indicated by a question mark (?).
Choose Team > Commit... to commit code to the local repository.
- In the Commit Changes dialog box displayed, set the commit message.
- Click Commit to commit the code to the local repository.
Step 4: Committing Code in the Local Repository to the Remote Git Repository
- Create a repositor in CodeArts Repo. For details, see Overview.
Go to the repository details page and copy the repository URL.
- Choose Team > Remote > Push... to push the code to the remote repository.
- In the Push to Another Repository dialog box, set the parameters.
- Click Next. The Push Ref Specifications dialog box is displayed.
- Click Add Spec.
- Click Next. The Push Confirmation dialog box is displayed.
- Click Finish.
- Click OK.
Log in to the remote repository and check the submitted code.
NOTE:
When Eclipse connects to the repository of CodeArts Repo using HTTPS, the message "Transport Error: cannot get remote repository refs. XXX.git: cannot open git-upload-pack" is displayed. This is because the EGit plug-in configuration in Eclipse is incorrect. Solution: Right-click in Eclipse and choose Windows > Preferences > Team > Git > Configuration > User Settings from the shortcut menu. Click Add Entry, set Key to http.sslVerify, and set Value to false.
Step 5: Creating a Merge Request in CodeArts Repo
Go to the homepage of the repository where a merge request is to be created, choose Merge Requests > Create MR, and select the source and target branches. The lower part of the Create MR page displays the file differences of the two branches and the commit records of the source branch.
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