SVN git collaborative management

Source: Internet
Author: User

There are always some strange demands in the project development process.

 

SVN is used for project management. SVN is a historical reason and the entire project cannot be switched to git. Because I need to manage SVN and do some code merge work. During each merge, SVN code needs to be compared and checked to check the code. You often need to optimize your code. The intermediate optimized version cannot be submitted. If the optimization is too large, it may lead to code errors, and the whole person may feel bad.

Therefore, it is much better to use SVN + git to work together.

 

Method:

Add the ignore attribute to the svn directory.

Example: SVN/trunk/example directory

Cd svn/trunk/examplesvn propedit SVN: Ignore./The edit interface is opened. Git. gitignore is saved and exited.

By editing the svn: ginore attribute of SVN, you can ignore the directories used by git.

Create a git repository in the SVN/trunk/example directory

cd svn/trunk/examplegit initgit co -b svngit add *git commit -m "Git init, the save version as svn-rxxxx"

In this way, a local git can exist.

 

The GIT warehouse can also have a remote warehouse. The command for creating a remote warehouse is as follows:

git init --bare svn-repopushd svn-reposcd hookscp post-update.simple post-updatepopd

 

Use the SSH protocol to host the svn project to a remote warehouse,

cd svn/trunk/examplegit remote add origin [email protected]:~/svn-repogit push origin svn:svn

Because the SSH protocol is used, it is assumed that the username of the SSH target server is GIT and the server name is Git-server (IP addresses can also be used ).

 

Through the above operations, example has been hosted on both SVN and git. In this way, SVN can only store stable versions on servers.

 

SVN git collaborative management

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.