How to correlate svn and git-managed code locally

Source: Internet
Author: User

Both SVN and git are widely distributed code versioning tools, and the actual project will often combine the two, so how to associate a local code with the two organically!

Premise: The project is already in the development phase, at this time changed the address of the SVN code base, or the group of new people, need you to help configure the environment, what do you do?

My practice flow is as follows: (PS: Not necessarily the optimal operation and optimal solution, the problem can be solved)

1. In the local workspace directory,SVN co ' svn path ';

2. Go to the project root directory of checkout, execute git init command, initialize git (will generate. git folder in root directory);

3. Execute git remote add origin ' git remote code base address '(this command is used to create a name for the remote Git codebase, usually from Origin);

4. If the git remote Verification is successful, the following results show that the creation was successful:

5. To perform git remote show Origin, you can view the branching structure of the GIT remote code base, as follows:

6. Execute git flow initand build a local GIT branch management model (git flow init is OK);

7. You will want to pull to the local branch, the first to establish a local branch of the same name, and then execute the GIT pull origin ' branch name '(this step completely personally come up with a stupid method, there is a good way to look at the maze);

After the 8.git branch code is pulled to the local, it resolves the conflict between the SVN code and the GIT branch code (typically more often than the SVN code).

By this step the SVN code and GIT code will be associated.

If you have a remote branch that you want to delete, you can execute git push origin--delete ' branch name 'to remove the branch of GIT Remote code repository.

A hint like this might appear when someone else uses git remote show Origin to view the GIT remote code base:

Clear his approach is:git remote prune origin ' branch name ', after the execution of Git remote show origin will no longer see the above hint.

PS: This is a purely practical operation blog, without any in-depth analysis of the principle, the principle part of the hope that personal follow-up, can explain the more clear and thorough.

How to correlate svn and git-managed code locally

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.