好的做法是将sit与git一起使用 [英] Good practice to use git together with svn
问题描述
问题在于很多项目都是基于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
不适用于您计划<
颠覆不代表任何合理或有用的合并方式;因此使用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
usersclone
,fetch
anddcommit
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 gitformat-patch
andgit am
, or just 'dcommit’ing to the SVN repository.Running
git merge
orgit pull
is NOT recommended on a branch you plan todcommit
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屋!