Uploading Local Code to CodeArts Repo
Background
CodeArts Repo allows you to perform Git initialization on local code and upload the code to a CodeArts Repo repository.
Procedure
- Create an empty repository in CodeArts Repo.
- Do not configure Programming Language of .gitignore.
- Deselect Allow generation of a README file.
- Prepare the source code to be uploaded on the local computer.
- If the source code is from the SVN server, refer to Migrating an SVN Repository.
- If the source code is not managed by any version control systems, run the following Git command in the root directory of the source code (Git Bash is used as an example):
- Initialize a Git repository on the local computer:
git init
- Add the code files to the local repository:
git add *
- Create an initial commit:
git commit -m "init commit"
- Initialize a Git repository on the local computer:
- Set a remote server address for the local repository.
- If the Git repository is cloned from other systems, run the following command to add a new remote repository:
git remote add new git@***.***.com:testtransfer/Repo1.git # (replace the part after new with the repository address)
The repository address is displayed on the repository details page. The following figure shows how to obtain the repository address.
- If the Git repository is just initialized, run the following command to add a remote repository named origin.
git remote add origin git@***.***.com:testtransfer/Repo1.git # (replace the part after origin with the repository address)
- If the Git repository is cloned from other systems, run the following command to add a new remote repository:
- Push all code to CodeArts Repo.
git push new master # (when the Git repository is cloned from other systems)
git push origin master # (when the Git repository is just initialized)
Basic Git knowledge is required for the preceding operations. If you have any questions during the operation, see the Git website or contact technical support.
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