Methods for using SVN synchronization and automatic code deployment between Windows, Linux and Linux servers

Source: Internet
Author: User

Summary:

In the home PC, when the company uses the office computer to modify the code of a project, it encounters the problem of code synchronization. This article explains the workarounds for Code synchronization and automatic deployment.

Implementation method: 

1. First install SVN (sudo yum install svn) on Linux servers and Linux.

2. Then create a repository on the service and configure users and permissions, this online method is more, self-Baidu.

3. Synchronize with the SVN command on the Linux client, as follows:

SVN Co svn://(IP address) (folder where files are saved) # #检出版本库. The first time to enter a user name and password.

Copy the Code (project) that needs to be synchronized to the checked-out folder.

SVN add * # #添加文件, this may appear svn:e200009: Because some of the targets are versioned, you cannot add all the targets and execute the SVN add *--force Force addition.

Then execute $ svn commit-m "log" to upload into the library and automatically deploy (automatic deployment is explained below) # #log to modify the log

4.window is simple, directly download SVN, tube home has. After installation, in the right-click menu there are SVN checkout options, select Check out, and then enter the user name and password is OK.

Automatic Deployment method:

1. Go to the Linux repository under SVN, locate the Hooks folder, and enter. The files here are some scripts that will be executed automatically after an operation.

2. Execute command CP Post-commit.tmpl Post-commit

3. Execute command chmod 777 post-commit modify file permissions

4. Execute the command vim post-commit open the file, clear the existing content, add the following statement:

Export LANG=ZH_CN. UTF-8 # #设置编码方式

SVN=/USR/BIN/SVN # #设置svn路径, note not project path

App=/root/test # #设置目标路径, which is where you want it to be deployed automatically after you synchronize the code

${SVN} Update ${app}--username (your user name)--password (your password)

5. You are done.

PS: The first time to write a Bo, welcome correction

Methods for using SVN synchronization and automatic code deployment between Windows, Linux and Linux servers

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.