How to use version control on a remote development server?

試著忘記壹切 提交于 2019-12-12 04:31:22

问题


I'm in a small team of developers and designers, developing web applications and now we decided to start using version control. We have main development server where all projects are stored and we work on them through ftp(but we have ssh access).

The questions is, what is the best way to update files on a server after someone pushed a commit on it, so all the changes could be instantly seen in a browser? As far as I know a git repository should be 'bare' to be able receive push's, and since it's 'bare' - it has no working files. Does that mean that git is no use for that or there is way?

In Mercurial pushed commit have to be applied locally for files to change. Should it be done through some kind of hooks?

And I don't actually know how svn behave in this situation, never used it.

The solution should be easy to use and compatible with GUI clients.


回答1:


Look for "hooks", that are scripts called by your version control software when some specific events occurs, like when a changeset has been pulled in the repository. That feature is available in SVN, GIT, Mercurial, Bazaar...

I currently have a hook on a central mercurial repository holding a WIP website : when someone of the team push his changes there, a test version of the website is updated automatically by the hook script. Then when we're satisfied with a version, we use another script to move this version to the beta website, that some users will be able to check.




回答2:


There's no need for a working tree to have web access to your repo. See docs on GitWeb.



来源:https://stackoverflow.com/questions/7251016/how-to-use-version-control-on-a-remote-development-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!