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

标签 git svn svn2git

我们正在将旧的 SVN 存储库迁移到 Git。这与 svn2git 配合得很好.现在我们想专门在 git 上工作,但需要将任何新的 git 提交镜像到旧的 SVN 存储库。这是必要的,因为一些生产系统仍然通过 SVN 部署。

所以我尝试在我之前运行 svn2git 的同一个存储库上使用 git svn 。我还不是专家,但我想,像这样的东西应该可以解决问题:

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

我也尝试获取一些关于导入的SVN数据的信息:

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

所以看起来好像 svn2git 做了一些魔术并且让 git svn 处于“未配置状态”。 据我所知,git 必须保留一些引用以将 SVN 提交映射到 git 提交。相反的命令 svn2git --rebase 起作用:它获取任何新的 SVN 提交并将它们应用到 git 仓库。所以数据似乎在那里并且可供 svn2git 使用(AFAIK 基于 git svn)。

那么我怎样才能让 git svn 工作呢?还是有另一种方法可以让我们从新的存储库向后移植 git 提交到 SVN(无需从头开始)?

最佳答案

尝试“git svn rebase”。

我遇到了完全相同的问题并使用了托管在@vhttps://github.com/nirvdrum/svn2git 上的包装器脚本。 请抽空阅读SVN to GIT migration failed using svn2git .

关于git - 在使用 svn2git 创建的 repo 上使用 git svn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16164144/

相关文章:

git - 防止 gradle-wrapper.properties 一直变化

node.js - 使用nodeJs和 "svn-spawn"模块访问SVN

git - 制作线性主分支git

git - 如何在 Git 中完全删除 .svn 文件

git - git忽略所有同名文件

windows - 无法升级 SVN 工作副本

git - 为什么 `git-svn`卡在 `Found possible branch point:`

git - 将本地 svn repo 转储转换为 git

git - 在另一个 git 仓库中维护一个 Git 仓库

svn - 我应该将 TeamCity 的 VCS 根指向哪里?