如何在不同语言的项目中使用版本控制?
当我们频繁开发 Web 应用程序时,我们有大量多种语言的代码(HTML、CSS、JS、PHP、AS3 等)。
是为每种语言使用不同的存储库还是为所有应用程序使用一个全局存储库更好?
When we are developing web applications frequently we have a lot of code in many languages (HTML, CSS, JS, PHP, AS3, etc).
Is better to have a different repository for each language or just one global repository for all the application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
版本控制系统通常按项目划分,而不是按源语言划分。
如果您正在构建一个Web应用程序,那么这是很正常的事情(而且完全没问题)其中包含不同编程语言的文件(HTML、CSS、PHP、JS 等)。
回答您的问题:
不,为每种源语言使用不同的存储库并不是一个好主意。
只需对所有应用程序使用一个存储库。事实上,大多数公司可能都会拥有一个存储公司所有项目的存储库。
Version control system are usually split by projects, not by source language
If you are building a, say, web application, it is a normal thing (and it's perfectly fine) to have files with different programming languages in it (HTML, CSS, PHP, JS, etc).
To answer your question:
No it is not a good idea to have a different repository for each source language.
Just use one repository for all the applications. In fact, most companies will probably have one repository for all the projects in the company.
没有理由按源语言分割存储库。只需使用一个公共主干 - 并像在 tar 存档中一样组织您的代码。换句话说,让项目的逻辑决定如何归档它。
SVN 可以处理许多不同的文件类型,而且几乎所有情况下源都是 ASCII 文本。
There is no reason to split the repository by source language. Just use one common trunk -- and organize your code as you would in a tar archive. In other words, let the logic of your project determine how you archive it.
SVN can deal with many different file types, and sources are after all ASCII text in almost all cases.
这取决于你,真的。我建议存储库代表应用程序。这种方式(应用程序->存储库,模块->根目录)比基于语言进行分离更符合逻辑。
It's up to you, really. I'd suggest that the repository represent the application. It's much more logical this way (app->repository, module-> root dir) than separating based on languages.