svn automatically synchronizes the project code to the website root directory to achieve instant updates

PHP中文网
Release: 2023-03-14 06:06:02
Original
3760 people have browsed it

I believe everyone is familiar with svn. When you first come into contact with the company's projects, you may find that their svn has the function of automatically synchronizing to the official website.

Isn’t it amazing?

The following takes the svn server installed under Windows as an example to teach you a few lines of code to implement this function.

Usually We use VisualSVN server-side software for the svn server, and the free tortoise svn software for svn locally.

post-commit is in the hooks directory of SVN.

post-commit.bat code is as follows:

@echo off
SET REPOS=%1
SET REV=%2
SET SVN="C:/Program Files/VisualSVN Server/bin/svn.exe"
SET DIR=%REPOS%/hooks
SET PATH=%PATH%;
SVN update F:/wroot123/ --username ww --password ww
rem "F:/wroot123/"目录必须先checkout
Copy after login

There are many such tutorials on Baidu, but because they are too complicated, I don’t want to learn them after just reading them. This article is Simplified version, hope it helps you.

To learn PHP, go to the PHP Chinese website.

This article is edited by php Chinese website,

Article address: http://www.php.cn/php-weizijiaocheng-374260.html

Please do not reprint~~ ~~

The above is the detailed content of svn automatically synchronizes the project code to the website root directory to achieve instant updates. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!