SVN migration Gitlab step

Outline

The company will be required prior to use SVN to manage the migration project to Gitlab project management, operation and maintenance Rom but our side of the SVN server, so we have to own the project to migrate SVN Gitlab. Yeah! I finally have the opportunity of a performance.
SVN commit record retention requirements on the
overall execution of the following steps:

  1. Corresponding to the account
  2. git-svn SVN pull the original project
  3. Submit the project to the Gitlab

Steps

Next we were converted.

Corresponding to the account

SVN is the user account used to submit records show, but git using the account and mailbox staff confirmed, so we need to use both the correspondence.
Create a txt text document, the name taken lightly (but here I use is svn2git.txt), the text reads as follows: zhangsan=zhangsan <[email protected]>the left side of the equal sign is SVN account the right of the equal sign is Gitlab account and mailbox information ( note: outgoing staff have to convert, otherwise error ).
Do not worry, SVN account can be commanded to turn out.
Go to the directory corresponding to the account you want to save the file (I am here is svn2git.txt) of (I use the root directory in d: Open your Git BASH (you have to install Git only after a) cd /d),
execute the following command:svn log 你的SVN项目的url -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2"="$2" <"$2"@gmail.com>"}' | sort -u > ./svn2git.txt , Linux this is done using the awk command svn export account information format, of course, I use something gmail mailbox, you can customize the mailbox, open look is not above the text format is the same.

git-svn to pull SVN project

Yes, git git-svn built a tool that you can use git-svn according to git svn way to manage the project, but it is strongly recommended not to do it.
Next, using git-svn SVN pull your project, the command is as follows:git svn clone "你的SVN项目的url" --no-metadata --authors-file="d:/svn2git.txt" 你自定义的项目名 It is the use of your account corresponding to the conversion SVN commit record for the record submitted to git.

Submit the project to gitlab

Switch to project directory using Git-svn pulled under execution: git config --local user.name "你的gitlab用户名", , git config --local user.email "你的gitlab邮箱"these two items is the user configuration information
git remote add origin 你的gitlab项目的git地址(注意使用http开头的,不雅用git开头的), git push -u origin masterwhich is a command to add two remotely operated url and pushing the remote.

to sum up

Migration is through svn git git-svn commit record corresponding to the user, and then pushed to the new project. It is recommended that you let the code to be submitted prior to submitting all up and then started to push, otherwise you have to copy the code copied to the new project.

Guess you like

Origin www.cnblogs.com/Lenbrother/p/11496869.html