SVN sync Web file under Windows environment

Source: Internet
Author: User
Tags commit svn svn update test web server version control system

SVN is commonly used in team development and is a very convenient version control system.

If you can automatically publish the data on the SVN server to the Web server, it will be the entire project development, testing more convenient. With the SVN hook feature, you can synchronize data on the SVN server to the Web server.

Ideas:

Locate the Repository (repositories) folder in the SVN server and locate the Hooks folder in the appropriate project folder. Add a Post-commit file to the folder, and when a commit action occurs (when committed to SVN server) The Post-commit file is executed and the data is replicated in the file.

Instance:

Environment: SVN server is on the same Windows System server as the test Web server, and SVN server uses Apache for Visualsvn,web server. The name of the project is test, The client uses TORTOISESVN.

First in the Apache WWW directory to create a folder, to checkout, enter the need for user name and password, the test item to be removed to the folder.

Locate the repositories directory for the SVN server and create the Post-commit.bat in the Repositories/test/hooks folder where you write the command:

"C:Program filesvisualsvn Serverbinsvn.exe" Update "D:wwwtest"--quiet--username name--password pwd

(That is, to execute the SVN update command, replace the user name and password yourself)

Can also be written like this

@echo off

Set repos= "%1"

Set txn= "%2"

"C:Program FilesSubversionbinsvn.exe" Update "F:wwwroot"--quiet--username admin--password admin

All right, it's done.

Related Article

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.