git 与 svn 界面?
有没有办法使用 svn 的命令集连接 git 存储库?
背景:我们团队的大多数成员都希望将我们所有的新项目从 svn 切换到 git,但也有一些反对者。
我知道可以使用 git 访问 svn 存储库,但我正在寻找相反的功能。
Is there a way to interface a git repository using svn's command set?
Context: most of the members of our team want to switch to git from svn for all our new projects, but there are a few dissenters.
I know that it is possible to access an svn repo using git, but I'm looking for the opposite functionality.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
从根本上来说不行——除非做出可怕的假设和简化,而这些假设和简化肯定会给你带来麻烦。从非分布式 VCS 迁移到分布式 VCS 并有效利用它,需要您改变思维方式。 http://hginit.com/00.html 有一些关于从 svn 迁移到 hg 的注释,这将是同样适用于这种情况。
Fundamentally no - not without making terrible assumptions and simplifications that are guaranteed to come back to bite you. Moving from a non-distributed to a distributed VCS, and making effective use of it, requires you to change your mindset. http://hginit.com/00.html has some notes on moving from svn to hg which would be similarly appropriate to this case.
我一直在做的是使用 svn 作为权威源,但是所有 git 开发人员在共同工作时都连接到 gitorious项目。例如,当任务完成时,正在处理配对任务的人会根据需要进行变基并使用 git svn 进行颠覆。
这不是一个完美的解决方案,但至少它可以让您在 git 下与其他 git 开发人员本地工作。
你真正需要做的是将保留的内容放到 git 上。这似乎是唯一真正可持续的长期解决方案。
What I've been doing is using svn as the authoritative source, but all the git developers connect to gitorious while working together on projects. When tasks are complete, someone who is working on a paired task, for example, rebases as necessary and commits to subversion with
git svn
.It's not a perfect solution, but it lets you work locally under git with the other git developers, at least.
What you really need to do is get the hold-outs onto git. That seems to be the only real sustainable long-term solution.
如果不是每个人都对这一举动感到满意,你可以考虑拥有一个 SVN 服务器并要求任何想要使用 git 的人使用 git-svn。 Git 的学习曲线非常陡峭。因此,即使是对使用 Git 感到兴奋的人,也可能在使用它时遇到问题,并且在项目中,它会降低你的生产力。最好让每个人都通过 git-svn 来学习 git,因为如果需要的话,还有另一种工作方式 - 通过 SVN。如果人们对 git 有经验,那么此举可能会非常富有成效。否则,可能会出现很多中短期问题。我也遇到过这种情况,说说我的经历。
否则,使用 TortoiseSVN 的人应该熟悉 Windows 上的 TortoiseGit。另外,您可以从类似的 SVN 命令中为 git 中的某些命令设置别名,以便它们看起来执行类似的操作。就像
svn revert
与git revert
不同,但git reset --hard
是等价的。大多数时候很难找到同等的东西,但你可以找到其中的一些If not everyone is comfortable with the move, you can consider having a SVN server and ask whoever wants to use git to use git-svn. Git has a very steep learning curve. So even people who are excited about using Git, might have problems using it and in a project, it can kill your productivity. It is better to have everyone learn git via git-svn, since there is an alternative way to work - through SVN - if needed. If people are experienced with git, the move might be very fruitful. Otherwise, there might be lots of short to medium term problems. I have faced this, and am telling my experience.
Otherwise, TortoiseGit on Windows should be familiar to people using TortoiseSVN. Also, you can alias some of the commands in git from similar SVN commands, so that they seem to do similar things. Like
svn revert
is not same asgit revert
, butgit reset --hard
is kind of equivalent. It is hard to find equivalents most of the time, but you can for a few of them如果您使用的是 Windows,您可以尝试 TortoiseGit - 它与 TortoiseSVN 具有类似的界面。
但这是 GUI 相似性,而不是控制台命令相似性。
If you are on Windows, you may try TortoiseGit - it has similar interface with TortoiseSVN.
But this is GUI similarity, not console commands similarity.