简体   繁体   English

我们如何在共享工作环境中使用版本控制?

[英]How can we use version control in a shared work environment?

Currently our team (web devs, one designer and one copywriter) all work on separate workstations but do our changes on the same dev environment (we all mount the same shared drive), it's a marketing site and not a web application, so no builds or deployments, we just push changes to the live site once they are done, but I think it's important for us to keep versions of files, especially serverside code, even if it only makes up a tiny percentage of our content (mostly static pages). 目前我们的团队(网络开发人员,一名设计师和一名文案撰写人)都在不同的工作站上工作但是在相同的开发环境中进行我们的更改(我们都安装了相同的共享驱动器),它是一个营销网站,而不是一个Web应用程序,所以没有构建或部署,我们只是在完成后将更改推送到实际站点,但我认为保留文件版本(尤其是服务器端代码)非常重要,即使它只占我们内容的一小部分(主要是静态页面) 。

I'd like to use version control for our work setup, but I'm not sure if SVN or GIT will play along with more than one person checking in/out from the same dev environment. 我想在我们的工作设置中使用版本控制,但我不确定SVN或GIT是否会与多个人在同一个开发环境中签入/签出。 I've got existing experience with SVN, CVS, GIT, Perforce and PVCS but have always worked with individual dev environments. 我有SVN,CVS,GIT,Perforce和PVCS的现有经验,但一直与个人开发环境合作。

I'd like a solution that doesn't require us to run separate dev environments as we lack the infrastructure. 我想要一个不需要我们运行单独的开发环境的解决方案,因为我们缺乏基础设施。

Most, if not all, version control implementations are intended to be used by more than one person. 大多数(如果不是全部)版本控制实现旨在由多个人使用。 Both Subversion and GIT will happily do everything you require but you might find Subversion easier to get up and running with quickly. Subversion和GIT都很乐意为您提供所需的一切,但您可能会发现Subversion更容易启动并快速运行。 If you intend to host it in a Windows environment, take a look at VisualSvn Server . 如果您打算在Windows环境中托管它,请查看VisualSvn Server

The major difference between GIT and SVN is that GIT is a distributed system whereas SVN relies on a central repository. GIT和SVN之间的主要区别在于GIT是一个分布式系统,而SVN依赖于一个中央存储库。 In software development, there are good arguments for using a distributed system but the needs you describe would be easily served by the much simpler SVN implementation (I think). 在软件开发中,使用分布式系统有很好的理由,但是你所描述的需求很容易通过更简单的SVN实现来实现(我认为)。

Another good reason for using SVN (under Windows) is that the TortoiseSvn client is one of the best examples of a user interface to any version control system. 使用SVN(在Windows下)的另一个好理由是TortoiseSvn客户端是任何版本控制系统的用户界面的最佳示例之一。 It is extremely easy to learn how to use and well documented as well as supported by the OS community. 它非常容易学习如何使用和记录良好以及OS社区支持。

It may also be worth investigating the various providers of hosted version control systems if you don't want the overhead of maintaining your own source control servers. 如果您不希望维护自己的源代码控制服务器的开销,那么托管版本控制系统的各种提供商也可能值得研究。

You don't need lots of server hardware. 您不需要大量的服务器硬件。 Why can't each dev/designer/etc run the site on their own computer? 为什么每个dev / designer / etc都不能在自己的计算机上运行该站点? You do have atleast one computer each? 你每个至少有一台电脑? :) :)

GIT or SVN in that case is just a matter of taste. 在这种情况下,GIT或SVN只是一个品味问题。

the way we used to do this at an old workplace was to give each user an account, and give the "project" and account as well. 我们以前在旧工作场所这样做的方式是给每个用户一个帐户,并给出“项目”和帐户。 We would each check out a local working copy. 我们每个人都会查看当地的工作副本。 the project (in your case it would be the tools that people in your business use i guess) would check out a copy too. 该项目(在您的情况下,它将是您的业务人员使用的工具我猜)也会检查副本。 Once the devs were all satisfied with a certain build, we would issue an update to the project working copy. 一旦开发人员对某个版本感到满意,我们就会对项目工作副本发布更新。

In your setup you say that you all have the same dev environment. 在您的设置中,您说您都拥有相同的开发环境。 do you mean you each have your own PC on the network, or are you sharing a PC? 你的意思是说你们每个人都有自己的网络电脑,或者你们共用一台电脑? either way you should be able to each have your own svn accounts and local working directoires, so this would not be a problem. 无论哪种方式,你都应该拥有自己的svn账户和本地工作指导,所以这不是问题。

Depending upon the amount of data you are talking about, an option to consider would be Dropbox ( "secure backup, sync, and file sharing made easy" ). 根据您所讨论的数据量,可以选择Dropbox“安全备份,同步和文件共享变得简单” )。 It supports versioning, and lets you share folders. 它支持版本控制,并允许您共享文件夹。

It also has the benefit of providing offsite backup of, and remote web access to, your data. 它还具有为您的数据提供异地备份和远程Web访问的优势。

With svn, you can have each submit automatically trigger an update of the live site. 使用svn,您可以让每个提交自动触发实时站点的更新。 Still having everyone work in the same directory is somewhat awkward (as it was all the time, anyway …), but old habits die hard and assuming people insist on that, svn does export its repository via WebDAV, so it should be possible to mount it as a network filesystem on the desktop machines. 仍然让每个人都在同一个目录中工作有点尴尬(因为它一直都是,但无论如何......),但旧习惯很难,并且假设人们坚持这一点,svn确实通过WebDAV导出其存储库,所以应该可以挂载它作为桌面计算机上的网络文件系统。

  1. " Currently our team (web devs, one designer and one copywriter) all work on separate workstations but do our changes on the same dev environment (we all mount the same shared drive) " Adding SVN would do away with the need for the shared drive. 目前我们的团队(网络开发人员,一名设计师和一名文案撰写人)都在不同的工作站上工作,但在相同的开发环境中进行我们的更改(我们都安装了相同的共享驱动器) ”添加SVN将消除对共享驱动器的需求。 You would each work in a local directory that is checked in to SVN. 您将在签入SVN的本地目录中工作。 Tortoise would be a perfect client for you. 乌龟将是您的完美客户。

  2. " it's a marketing site and not a web application, so no builds or deployments, we just push changes to the live site once they are done " A simple batch job (ANT script or other) could be written and given to each of you. 它是一个营销网站,而不是一个Web应用程序,因此没有构建或部署,我们只需在完成后将更改推送到实际站点 ”可以编写一个简单的批处理作业(ANT脚本或其他),并将其提供给每个人。 Once the files are ready for deployment simply execute the batch and have it check out the latest files from SVN and copy to your web server. 一旦文件准备好部署,只需执行批处理并让它检出SVN中的最新文件并复制到您的Web服务器。

"doesn't require us to run separate dev environments as we lack the infrastructure" “由于缺乏基础设施,我们不需要运行单独的开发环境”

Doesn't make a lot of sense. 没有多大意义。

Presumably, each of you has a separate workstation. 据推测,你们每个人都有一个单独的工作站。 And your workstations are separate from your web server. 您的工作站与您的Web服务器是分开的。 Just guessing, but that's typical. 只是猜测,但这是典型的。

You can -- trivially -- each have a private development copy on your workstations. 您可以 - 平凡 - 每个都在您的工作站上有一个私人开发副本。 You can then use SVN to synchronize your various changes. 然后,您可以使用SVN同步各种更改。

You can tag a version as "good to go". 您可以将版本标记为“好去”。

Someone can -- when you've got everything looking right -- do an update on the web server to get the official version into production. 有人可以 - 当你看起来一切正常时 - 在网络服务器上进行更新,以便将正式版投入生产。

This doesn't require any more infrastructure than you already have in place. 这不需要比现有基础设施更多的基础设施。

With SVN you can have the devs commiting to the server, and have one special user at the server checking out the latest version. 使用SVN,您可以让开发人员提交到服务器,并在服务器上有一个特殊用户检查最新版本。 So commiting you work involves commiting to SVN, then logging in to the server and do a checkout of the latest trunk. 因此,提交您的工作涉及提交到SVN,然后登录到服务器并检查最新的中继。

You can use the same pattern with git and other decentralized version control systems. 您可以使用与git和其他分散版本控制系统相同的模式。 The advantage with these systems is that they don't enforce the central server pattern. 这些系统的优点是它们不强制执行中央服务器模式。 Dev a could for instance push to b which then pushes it to the server. Dev a可以例如推送到b然后将其推送到服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM