multiple source code repositories

风流意气都作罢 提交于 2020-01-14 08:18:11

问题


I use Mercurial for version controlling my source code. But some people prefer other version control systems (like git, Bazaar, SVN, CVS).

I would like to know, is it possible to store a repository under multiple systems at once, so people can use whichever repository they want?


回答1:


GitHub developed the hg-git extension for Mercurial. This extension allows you to clone from git repositories using Mercurial, and then push back in. So if you didn't mind having a central git repository, then it would certainly be possible to access it using both git and mercurial.

Though as another answer has pointed out most of the VCS tools you mentioned are fairly similar to use, so it's questionable whether it would be worth putting in the effort to allow people to use whatever they want, compared to the minimal effort involved in learning a new system.




回答2:


is it possible to store a repository under multiple systems at once

I think the answer is no, as a repository has a specific format linked to the application.

The best thing to do it to authorized other developer to use the client application that fit their needs, if it is compatible with your work process.

Example : You have an existing SVN repo and another Git repo. As a developer, I would like to use only BZR. I can use the bzr-svn or bzr-git plugin to branch from SVN or Git, commit locally with BZR (and benefits from BZR features), and then push the result back to SVN or Git.




回答3:


I don't know about Mercurial but with AccuRev it is possible to maintain your source code in AccuRev and Git. The plugin Kando takes care of replication from AccuRev to Git and vice-versa. For more details have look at http://www.accurev.com/kando




回答4:


Not easily - you would have to keep each one in sync with the other, via a multitude of hook and event scripts. It is possible, for example, to checkout from subversion, do an hg init in that folder, and temporarily work using mercurial, and then eventually commit back to subversion when you're happy (ensuring you don't add and commit and .hg files). Also depending on the number of developers you could get into all sorts of problems with conflicts from merges if two developers commit to the same file under different version control systems.

Since Subversion (and CVS) are centralised version control systems, and git, bazaar, and mercurial are all distributed, keeping them in sync would require choosing a master copy for each one.

The VCS tools you mention are all fairly similar on the command line (though CVS really shouldn't be used any more), so the learning curve for other users isn't particularly steep.




回答5:


It depends whether the conversion tools is easy to choose and use e.g. git: git-svn is officially supported, it is build-in in Windows version and easy to install in debian/ubuntu with deb packages

hg:
https://www.mercurial-scm.org/wiki/WorkingWithSubversion
https://www.mercurial-scm.org/wiki/RepositoryConversion#Subversion with many types of converters to choose from, and many of them requires some setup

bzr:
bzr-svn is built-in in Windows version and it is officially supported
details here: http://wiki.bazaar.canonical.com/ForeignBranches/Subversion



来源:https://stackoverflow.com/questions/9392046/multiple-source-code-repositories

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