Updated on 2023-08-07 GMT+08:00

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

  1. Create an empty repository in CodeArts Repo.

    • Do not configure Programming Language of .gitignore.
    • Deselect Allow generation of a README file.

  2. 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):
      1. Initialize a Git repository on the local computer:
        git init

      2. Add the code files to the local repository:
        git add *
      3. Create an initial commit:
        git commit -m "init commit"

  3. 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)

  4. 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.