Using Git and SVN configuration under Linux

Source: Internet
Author: User
Tags svn using git

Git svn command

All of the Subversion bridge commands in Git are based on git svn. All commands start with it. The number of related commands, this article but more introduction git svn command use, only a simple description of the most commonly used, more knowledge reference Secretary Pro git.

To organize the mapping of user name and email

In Subversion, each submitter has a user name on the host, which is recorded in the submission information. If you want to better map existing information to git author data, you need a mapping relationship from the Subversion username to the git author, because Git identifies a submitter by using a mailbox. Create a file called User.txt, each line of svn author = author Nickname < e-mail address, with the following format to represent the mapping relationship:

User.txt's Demo

Schacon = Scott Chacon <schacon@geemail.com>
Selse = Someo Nelse <selse@geemail.com>

The author name of all the authors of the SVN code can be obtained by the following command:

Get the author name of SVN submission


SVN Log--xml | grep "^<author" |  Sort-u | \
Awk-f ' \<author\> ' {print $} ' | Awk-f ' \</author\> ' {print $} ' > User.txt


Get the following text, and then edit the author's message information according to the above format.

Get the name of SVN's author

Schacon
Selse
So we have the author, the mailbox user.txt that have SVN's submission record ready, and then cloning SVN's address.

Clone SVN's trunk to local

Git svn clone http://example.com/path/to/project-x/trunk \
--authors-file=users.txt Project-x
Http://example.com/path/to/project-x/trunk is the SVN project address, which uses the trunk directory.
--authors-file=users.txt is the author of the SVN information that git needs to use.
Project-x is the folder name
--no-metadata parameter can not be SVN information, suitable for use when migrating, not suitable for git SVN shared

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.