Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Migrating an SVN Code Repository

Updated on 2024-11-22 GMT+08:00

Import an SVN repo 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 repo type to Import and import from SVN. For details about how to set parameters, see Table 1.

    Table 1 Parameters for importing the SVN repo

    Parameter

    Description

    Source Repository URL

    Mandatory. Specify the repo path to be imported. The source repo path must start with http://.
    NOTE:
    • If the repo file is too large or the network quality is poor, it may take more than 30 minutes to import the repo file. If the import times out, you are advised to clone or push the client. For details, see Using Git Bash to Import an SVN repo to CodeArts Repo.
    • Online import is simple, and branches and tags in the SVN can be moved. If you want to continue development based on the code repository, use the Git Bash client to import the code repository. For details, see Using Git Bash to Import an SVN repo to CodeArts Repo.
    • The repository domain must be connected to the service node.

    Verification to Access Source Repo

    Mandatory. There are two cases:

    • If the imported source repository is open to all visitors, select Not needed.
    • If the imported source repository is private, select Needed. Currently, two authentication modes are supported: By service endpoint and By personal access token. For details about how to set parameters, see Verifying the Import Permission.

  3. Click Next. On the Basic Information page, set parameters by referring to the parameter table.
  4. Set the parameters for syncing a repo by referring to table 1.

Using Git Bash to Import an SVN repo to CodeArts Repo

  1. Obtain committer information of the SVN repository.

    1. Use TortoiseSVN to download the repository to be migrated to the local computer.
    2. Go to the local SVN repository (KotlinGallery in this example) and run the following command on the Git Bash client:
      svn log --xml | grep "^<author" | sort -u | \awk -F '<author>' '{print $2}' | awk -F '</author>' '{print $1}' > userinfo.txt

      After the command is executed, the userinfo.txt file is generated in the KotlinGallery directory, as shown in the following figure.

    3. Open the userinfo.txt file. You can view the information about all committers who have committed code to the repository in the file.
    4. Git uses an email address to identify a committer. To better map the SVN repository information to a Git repository, create a mapping between the SVN and Git usernames.

      Modify userinfo.txt so that in each line, SVN author = Git author nickname <email address >. The following figure shows the mapping format.

  2. Create a local Git repository.

    1. Run the git init command to create an empty Git repo directory on the local PC.
    2. Copy the userinfo.txt file in step 1 to the directory and run the following command to switch to the directory:
      cd Destination directory address
    3. Start the Git Bash client in the directory and run the following command to clone a Git repo:
      git svn clone <svn_repository_address> --no-metadata --authors-file=userinfo.txt --trunk=trunk --tags=tags --branches=branches

      The following table lists parameters in the command. Set the parameters as required.

      Parameter

      Description

      --no-metadata

      Indicates that the SVN metadata is not imported to the Git repo. In this way, the size of the Git code repo is reduced, but some SVN historical information may be lost.

      --authors-file=userinfo.txt

      Indicates that the specified user information file is used for author information mapping.

      --trunk=trunk

      Indicates that the trunk branch in SVN repo is used as the main branch of Git code repo.

      --tags=tags

      Indicates that the tags directory in the SVN code repo is used as the tag of the Git code repo.

      --branches=branches

      Indicates that the branches directory in the SVN code repo is used as the branch of the Git code repo.

      After the command is executed successfully, a Git code repo named KotlinGallery is generated locally.

    4. Run the following commands to go to the KotlinGallery folder and verify the current Git repository branch structure:
      cd KotlinGallery
      git branch -a

      As shown in the preceding figure, all directory structures in the SVN are successfully migrated in the form of Git branches.

  3. Correct local branches.

    Therefore, before uploading tags to CodeArts Repo, adjust the local branches to comply with the Git usage specifications.

    1. Go to the local Git repository and run the following commands on the Git Bash client to change the tags branch to appropriate Git tags:
      cp -Rf .git/refs/remotes/origin/tags/* .git/refs/tags/
      rm -Rf .git/refs/remotes/origin/tags
      git branch -a
      git tag

    2. Run the following commands to change the remaining indexes under refs/remotes to local branches:
      cp -Rf .git/refs/remotes/origin/* .git/refs/heads/
      rm -Rf .git/refs/remotes/origin
      git branch -a
      git tag

    3. Run the following commands to merge the trunk branch into the master branch and delete the trunk branch:
      git merge trunk
      git branch -d trunk
      git branch -a
      git tag

  4. Upload the local code repository to CodeArts Repo.

    1. Set the SSH key of the code repo. For details, see Configuring the SSH Key.
    2. 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.
    3. Set Repository Type to Common, enter related parameters, deselect Generate README and set .gitignore Programming Language to create a code repository. The homepage of the code repository is displayed.
    4. Choose Clone/Download > Clone with HTTPS in the upper right corner and copy the HTTPS address.
    5. Run the following command to associate the local code repo with CodeArts Repo and push the master branch to the code repo of CodeArts Repo: When running commands, enter the HTTPS account and password of CodeArts Repo.
      git remote add origin HTTPS address of the new code repo
      git push --set-upstream origin master

      After the push is successful, go to the code repo homepage and choose Code > Branches to view the master branch in the current code repo.

    6. Run the following command to push other local branches to CodeArts Repo:
      git push origin --all

      After the push is successful, go to the code repo homepage and choose Code > Branches. The r1.1_hotfix branch is added to the code repo.

    7. Run the following command to push tags from the local host to CodeArts Repo:
      git push origin --tags

      After the push is successful, go to the code repo homepage and select the code > Tags. The r1.0 and r1.1 tags exist in the code repo.

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback