SVN migrated to git under the notes

Source: Internet
Author: User
Tags svn

Simple and rough, the orders are as follows:

git svn clone https://localhost:8443/svn/www/–no-metadata–trunk=trunk www

Parameter description:

The no metadata parameter is to prevent Git from exporting the additional information that SVN contains, so the record submitted to Git will look "clean"

Trunk Main Branch

Name of git project created by www

The execution process may have an SVN account input, anyway, the username and password.

2. After cloning the code, this is already a git under the checkout project, but he has no code base source, simply that he does not have a git under the fixed home (his birth mother is svn, he must find a stepmother), so first in your GitHub, Or your company built a git platform, to create a WWW project git library, of course, can also create their own local, here is not detailed, and so on the code deployment will be said.

For example, the code library is as follows:

Git@gitlab.xxx.com:second/test.git

To prove that WWW does not have a new mother, you can use the command:

git remote-v Check to see if there is a source, it's done.

The next step is to bring your WWW library back to Test.git, the mother's home, as follows:

git remote add git@gitlab.xxx.com:second/test.git

Once you've done that, you can perform another git remote-v you'll find as follows:

Origin just Google translated a bit, is the meaning of origin, in fact, in the implementation of GIT remote add originally need to give the source a name, such as release source

You need to enter git remote add release git@gitlab.xxx.com:second/test.git, because www has no source, so the addition becomes the default source, which is the origin, so omit the origin

Here, has completed the process of understanding the new mother, what's next, yes, all the code to get home, orders as follows

git push

The code is complete from SVN to git.

In fact, in this process seems to have missed a step, did not create a branch under Git, git branch-a look, found that the default main branch master has been automatically created

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.