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

Importing a Local Git Repository to CodeArts Repo

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

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.

If the repo capacity of CodeArts Repo is about to be used up, go to the code repo details page and perform the following operations to clear code repo resources:

  • Choose Code > Branches, select unnecessary branches, and click to delete them.
  • Choose Code>Tags, select unnecessary tags, and click to delete them.
  • Choose Settings > Repo Management > Space Freeing and clear the cache data.
  • Choose Settings > Repo Management > Submodules and delete unnecessary submodules.

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