Help Center/ CodeArts Repo/ User Guide/ Migrating Code and Syncing a Repository/ Importing a Local Git Repository to CodeArts Repo
Updated on 2025-07-24 GMT+08:00

Importing a Local Git Repository to CodeArts Repo

Constraints

  • You need to create a new project or select an existing one.
  • You have the permission to create a repository. If not, refer to Configuring Repo-Level Permissions.
  • Before importing the repository, ensure that your CodeArts Repo has sufficient storage space. If it is almost full, clear the repository resources by referring to Clearing the Repository Memory.
  • After a code repo is created, only the creator can access the repo. Other project members need to be manually added to the repo and assigned with corresponding permissions. Therefore, you need to manually add members to the repository and configure access permissions for the new members.

Importing a Local Git Repository

If your repo has not been incorporated into any version system, such as Git or SVN, perform the following operations in the root directory of the source code to import the local code repository (master branch) to CodeArts Repo.

  1. Go to the CodeArts Repo homepage, click New Repository, and select an existing project from the Project drop-down list box or create a project.

  2. Set Repository Type to Common, enter parameters, deselect Generate README and .gitignore Programming Language, and a code repository is created. The homepage of the code repository is displayed.
  3. Run the git init command to create an empty Git repo directory on the local PC.
  4. Run the git add * command to add the file to the version library.
  5. Run the git commit -m "init commit" command to create an initial commit.
  6. Run the git remote add origin Remote repo address command.
  7. Run the git push -u origin master command to push the local Git repository to the code repository created in CodeArts Repo.

Importing a Local Third-Party Git Repository to CodeArts Repo

If you clone the code from a third-party Git repository to the local host and modify the code repository, you can perform the following steps to import the modified Git code repository (master branch) to CodeArts Repo:

  1. Go to the CodeArts Repo homepage, click New Repository, and select an existing project from the Project drop-down list box or create a project.

  2. Set Repository Type to Common, enter parameters, deselect Generate README and .gitignore Programming Language, and a code repository is created. The homepage of the code repository is displayed.
  3. Run the git commit -m "init commit" command to create an initial commit.
  4. Run the git remote add origin Remote repo address command.
  5. Run the git push -u origin master command to push the local Git repository to the code repository created in CodeArts Repo.