Associating the CodeArts Repo Repository
Before using CodeArts Repo, initialize the local project files to a Git repository and associate it with a CodeArts Repo repository.
Prerequisites
You have installed the Git client and bound the key of the Git client to CodeArts Repo.
Procedure
- Create a CodeArts Repo repository.
If you select gitignore based on your local code library, some non-development files will be ignored and will not be managed in Git.
- Initialize the local repository to a Git repository.
Open the Git Bash client in your repository and run the following command:
git init
The following figure shows that the initialization is successful. The current folder is the local Git repository.
- Bind the CodeArts Repo repository.
- Go to the CodeArts Repo repository and obtain the repository address.
- Run the remote command to bind the local repository to the cloud repository.
git remote add <repository_alias> <repository_address>
Example:
git remote add origin git@*****/java-remote.git # Change the address to that of your repository.
By default, origin is used as the repository alias when you clone a remote repository to the local computer. You can change the alias.
If the system displays a message indicating that the repository alias already exists, use another one.
If no command output is displayed, the binding is successful.
- Pull the master branch of the CodeArts Repo repository to the local repository.
This step is performed to avoid conflicts.
git fetch origin master # Change origin to your repository alias.
- Commit local code files to the master branch.
Run the following commands:
git add .
git commit -m "<your_commit_message>"
The following figure shows a successful execution.
- Bind the local master branch to the master branch of CodeArts Repo repository.
git branch --set-upstream-to=origin/master master # Change origin to your repository alias.
If the following information is displayed, the binding is successful.
- Merge the files in the CodeArts Repo repository and local repository and store them locally.
git pull --rebase origin master # Change origin to your repository alias.
The following figure is displayed, indicating that the merged repository has been placed in the working directory and repository.
- Push the local repository to overwrite the CodeArts Repo repository.
Run the push command because the repositories have been bound:
git push
After the operation is successful, pull the repository to verify that the version of the CodeArts Repo repository is the same as that of the local repository.
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