几个月前,我使用svn存储库配置了一个git。到目前为止,我只是使用svn存储库来更新所提供的应用程序。但现在我也想把事情做回。要做到这一点,我要提交的每个特性都需要位于单独的分支中。我读到了你应该如何创建一个新的分支等等,但我想我的git配置错误了,我没有任何分支信息等,我想我只有主干信息。下面是我的svn仓库在我的git配置中的设置:
[remote "origin"]
url = url-of-git-repository
fetch = +refs/heads/*:refs/remotes/origin/*
[svn-remote "svn"]
url = url-of-svn-repository/trunk
fetch = :refs/remotes/git-svn
[branch "master"]
merge = refs/heads/master
remote = origin
... other branch information below (these are git branches)现在,正如您所看到的,我的svn-remote url直接转到主干。我读到了关于添加这个的内容:
branches = branches/*:refs/remotes/*但是当我创建一个新的分支时,它会将它添加到主干/分支/。当我不添加行的时候,它就不知道分支的目标是什么。
你知道如何在不破坏现有分支、代码等的情况下解决这个问题吗?
打招呼,Daan
发布于 2011-05-24 22:48:40
我相信分支配置是相对于svn-remote url的。
下面是我们的配置,它是通过
git svn -s url-of-svn-repository/foo
(在foo文件夹中,我们有正常的主干/分支/标记结构)
[svn-remote "svn"]
url = url-of-svn-repository
fetch = foo/trunk:refs/remotes/trunk
branches = foo/branches/*:refs/remotes/*
tags = foo/tags/*:refs/remotes/tags/*您可以尝试调整以适应这种结构,或者使用-s参数重新克隆git svn。它将为您配置所有这些(--standard-layout)。
发布于 2011-06-14 23:41:51
这是一篇帮助我让git与svn合作的帖子,该项目有一个非常非正统的分支结构(对于出于某种原因使用SVN的公司来说,这恐怕是正常的)。
http://www.dmo.ca/blog/20070608113513/
https://stackoverflow.com/questions/3289811
复制相似问题