好的做法是将sit与git一起使用 [英] Good practice to use git together with svn

查看:318
本文介绍了好的做法是将sit与git一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Subversion在几年前很流行,现在git变得流行起来,越来越多的人想用git来取代Subversion。

问题在于很多项目都是基于Subversion的。所以问题是如何与Subversion一起使用git。不要完全替换svn,并使用git。



最简单的方法是根据已经签出的Subversion分支代码创建git。然后使用git来本地控制。修改后,提交给本地git服务器,然后使用Subversion签出到远程服务器。 Subversion就像包含git的容器一样。

顺便说一句,我使用xcode 3.x编码,之前尝试xcode 4,但感到失望。 (Xcode 4已经出来了,但没有重试)



你如何看待?或者有更好的选择?



谢谢

解决方案

Subversion就像包含git的容器


请务必阅读 git-svn

为了简单起见并与功能较弱的系统(SVN)进行互操作,建议所有 git svn 用户克隆 fetch 直接从SVN服务器获取dcommit ,并避免在git存储库和分支之间进行所有git clone / pull / merge / push操作。

在git分支和用户之间交换代码的推荐方法是git format-patch git am ,或者只是'dcommit'到SVN仓库。



运行 git merge git pull 不适用于您计划< dcommit 来自的分支。

颠覆不代表任何合理或有用的合并方式;因此使用Subversion的用户无法看到您所做的任何合并。而且,如果你从SVN分支镜像的git分支合并或拉出, dcommit 可能会提交给错误的分​​支。


所以你可以采用任何合并和出版工作流程,只要你离开SVN分支,你就可以独自镜像(以合并或分配的方式)。


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

解决方案

Subversion is just like container to contain git

Be sure to read the CAVEATS section coming with git-svn:

CAVEATS

For the sake of simplicity and interoperating with a less-capable system (SVN), it is recommended that all git svn users clone, fetch and dcommit directly from the SVN server, and avoid all git clone/pull/merge/push operations between git repositories and branches.
The recommended method of exchanging code between git branches and users is git format-patch and git am, or just 'dcommit’ing to the SVN repository.

Running git merge or git pull is NOT recommended on a branch you plan to dcommit from.
Subversion does not represent merges in any reasonable or useful fashion; so users using Subversion cannot see any merges you’ve made. Furthermore, if you merge or pull from a git branch that is a mirror of an SVN branch, dcommit may commit to the wrong branch.

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).

这篇关于好的做法是将sit与git一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆