简体   繁体   English

在使用svn2git创建的repo上使用git svn

[英]Using git svn on a repo created with svn2git

We are migrating an old SVN repository to Git. 我们正在将旧的SVN存储库迁移到Git。 This worked pretty well with svn2git . 这对svn2git非常有效。 Now we want to exclusively work on git but need to mirror any new git commits to the old SVN repository. 现在我们想要专门处理git,但需要镜像任何新的git提交到旧的SVN存储库。 This is necessary because some production systems still are deployed through SVN. 这是必要的,因为一些生产系统仍然通过SVN部署。

So I tried to use git svn on the same repository where I ran svn2git before. 所以我尝试在之前运行svn2git的同一个存储库中使用git svn I'm not an expert (yet) but i thought, something like this should do the trick: 我不是专家(但是)但是我认为,这样的事情应该可以解决问题:

$ git svn dcommit --interactive
Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty. at /usr/lib/git-core/git-svn line 780.

I also tried to get some information about the imported SVN data: 我还尝试获取有关导入的SVN数据的一些信息:

$ git svn info
Unable to determine upstream SVN information from working tree history

So it seems as if svn2git did some magic and left git svn in an "unconfigured state". 所以似乎svn2git做了一些魔法并让git svn处于“未配置状态”。 As far as I know git has to keep some references to map the SVN commits to git commits. 据我所知,git必须保留一些引用来将SVN提交映射到git提交。 The opposite command svn2git --rebase works: it fetches any new SVN commits and applies them to the git repo. 相反的命令svn2git --rebase工作:它获取任何新的SVN提交并将它们应用于git repo。 So the data seems to be there and usable by svn2git (which AFAIK is based on git svn ). 所以数据似乎存在并且可以被svn2git (AFAIK基于git svn )。

So how can I make git svn work? 那我怎么能让git svn工作呢? Or is there another way how we can backport git commits to SVN from that new repo (without starting from scratch)? 或者是否有另一种方式我们如何从新的仓库向gport提交git提交(无需从头开始)?

Try "git svn rebase". 试试“git svn rebase”。

I faced exactly the same issue and used a wrapper script hosted @vhttps://github.com/nirvdrum/svn2git. 我遇到了完全相同的问题并使用了托管@vhttps://github.com/nirvdrum/svn2git的包装脚本。 Please take come time to read SVN to GIT migration failed using svn2git . 请花时间阅读SVN到GIT迁移失败使用svn2git

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM