将 git 与 svn 一起使用的好习惯
Subversion 几年前就很流行,现在 git 也开始流行,越来越多的人想用 git 取代 Subversion。
问题是很多项目都是基于 Subversion 的。所以问题是如何将 git 与 Subversion 一起使用。不要完全取代svn,而使用git。
我能想到的最简单的方法是根据您已经签出的 Subversion 分支代码创建 git。然后在本地使用git进行控制。修改后,提交到本地git服务器,然后用Subversion检出到远程服务器。 Subversion 就像包含 git 的容器。
顺便说一句,我正在使用 xcode 3.x 进行编码,之前尝试过 xcode 4,但很失望。 (Xcode 4已经出来了,但还没有重试)
你觉得怎么样?或者还有更好的选择吗?
谢谢
Subversion was popular several years ago, now git is becoming popular and more and more people want to replace Subversion with git.
Problem is that a lot projects were based on Subversion. So question is how to use git together with Subversion. Do not replace svn completely, and use git.
The simplest way I can figure out is to create git based on the Subversion branch code you have already checked out. Then use git to control locally. After modifications, submit to local git server, then check out to remote server with Subversion. Subversion is just like container to contain git.
BTW, I am coding with xcode 3.x , try xcode 4 before, but disappointed. ( Xcode 4 has come out now, but no retry yet)
How do you think ? Or any better choices ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请务必阅读 附带的 CAVEATS 部分git-svn:
注意事项
因此,您可以采用 Git 的任何合并和发布工作流程,只要当您离开 SVN 分支时,您将单独镜像(就合并或变基而言)。
Be sure to read the CAVEATS section coming with git-svn:
CAVEATS
So you can adopt any merge and publication workflow with Git, as long as you leave the SVN branches you mirror alone (in term of merges or rebases).
我在这里创建了一系列有关如何使用 git-svn 的操作方法和截屏视频:
http://www.tfnico.com/presentations/git-and-subversion
其中您会发现 git-svn 镜像设置。理解和设置它需要一些努力,但它已经为我工作了近一年,并且有一个相当大的 SVN 存储库。
更新:一个简单而有价值的做法是始终使用
--prefix
选项初始化 git-svn 克隆。我已经在这里解释了原因。I've created a collection of how-to's and screencasts on how to use git-svn here:
http://www.tfnico.com/presentations/git-and-subversion
Among them you'll find a git-svn mirror setup. It's a bit of effort to understand and set up, but it's been working for me for nearly a year, with a fairly large SVN repository.
Update: An easy and valuable practice is to always initialize git-svn clones with the
--prefix
option. I've explained why here.