SVN Guide for Web Development

I am looking for some help using svn with web development.

Here are my questions.

  • I install SVN on my web server, but save project files on my PC until I “fix” them correctly?

  • How can I get the “pushed” files that I sent to the server in my directory, for example / home / site / public _html /. Basically, I would like to “commit” push files directly to my web directory. Is it possible?

  • I really don't understand the complete concepts of how this can work for web development. I have read at least a dozen manuals, but not one of them sets out step by step what I need to do.

A step-by-step guide on the above questions or an answer to the question of how to manually help me will be really appreciated.

running windows 7 @home (what I'm developing) to start the CentOS 5 server (live webserver)

Thanks for any help.

+4
source share
3 answers

When you speak:

basically I would like to “commit - click” files directly into my web directory. Is this possible?

It looks like you want to commit your changes to the SVN repository and automatically redirect them to the web server. If so, you can accomplish this using the post-commit SVN hook. On your system, in the SVN repository directory, this is a subdirectory called "hooks". Edit the ones called post-commit.bat and export to your web server, for example:

 svn export <svn_repo> <webserver_location> 
+3
source

Firstly, I recommend downloading Tortoise . This is an integrated desktop client for SVN. You can use this to commit your files to your repository.

Regarding the process:

  • You have local development on your PC.
  • When you are ready, commit the files to the repository
  • After completing the update, update your copy on your web server from the repository. You may have to do this through the command line. Here is a link to the SVN command line: http://svnbook.red-bean.com/en/1.8/svn.tour.cycle.html

You do not want to use SVN as an FTP client. It is intended for version control. Thus, the repository is a real, basic copy of your data. What is on your web server and on your local computer is a copy of this data. The reason for this is because you want the one copy you know to be a good working copy. SVN will allow you to return the code base back at any given time, so it will also work as an archive.

The above scenario assumes that you can verify and confirm that your code works on your PC. Do you have a version of your web server running on your PC?

+1
source

you make your changes on your pages and make an svn commit on them to save these changes as a revision on the svn server. When you want to get a blank copy on the web server, do the svn export in the directory where you want the files to be. This is different from svn checking because it does not add all the .svn metadata files that svn uses in the source control. This is also a drawback, because you need to export all the files every time. If you perform an svn check in a directory, all metadata will also be in the web directory, but you can easily delete it (possibly with a script). This will allow you to simply perform the svn update in the web directory to pull all your future changes to the web directory.

0
source

Source: https://habr.com/ru/post/1313241/


All Articles