如何在现有的git存储库中获取新数据并提交到svn?

发布于 2024-11-02 08:16:23 字数 425 浏览 3 评论 0原文

我正在使用 git-svn 从 git 获取 svn repo 中的数据。我使用一些周围的工作成功地将数据从 git 导入到 svn 与子模块(我将子模块转换为 git 的子树),并且工作正常。

但现在我陷入困境了。如果我想获取 git pull 现有 git 存储库的更新数据,它会为我提供本地分支上的所有更新数据,但我无法使用 git svn dcommit 命令 dcommit 到 svn,它会给我错误消息,如下所示:

Unable to determine upstream SVN information from HEAD history 
Perhaps the repository is empty. at /usr/libexec/git-core/git-svn line 521. 

Any非常感谢有关如何执行此操作的说明!

I am using git-svn to get a data in svn repo from git. I successfully did import data from git to svn with submodules (I converted submodules as sub-tree of git) using some around work, and it worked fine.

But now I am getting stuck. If I want get a git pull a update data of existing repos of git, it gives me all updated data on my local branch, but I am not able to dcommit to svn using git svn dcommit command it gives me error message as follows:

Unable to determine upstream SVN information from HEAD history 
Perhaps the repository is empty. at /usr/libexec/git-core/git-svn line 521. 

Any instructions on how to do this would be very much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱冒险 2024-11-09 08:16:23

我可能是错的,但我的理解是 git-svn 不能与上游 git repo 共享,只能与 subversion 共享。

我完全用我的 git 尝试做你想做的事情,从远程 git 存储库中拉取,然后推送到颠覆存储库。

我现在做的是使用 git 来执行我的 SCC,然后将文件复制到仅由 subversion 控制的本地树中,然后将其签入 subversion。

我编写了一个 ruby​​ 脚本,它在本地 git 工作树和本地 subversion 之间进行同步。它只复制已更改的文件和我关心的文件。然后我从 subversion 工作树执行正常的 svn ci 操作。

好吧,我在这里找到了我的理解来源... http://git-scm.com/docs /git-svn 标题下的警告...

为了简单起见
与能力较差的设备进行互操作
系统(SVN),建议
所有 git svn 用户克隆、获取和
d直接从SVN服务器提交,
并避免所有 git
克隆/拉取/合并/推送操作
git 存储库和分支之间。
推荐的兑换方式
git分支和用户之间的代码是
git format-patch 和 git am,或者只是
“dcommit”到 SVN 存储库。

运行 git merge 或 git pull 不是
推荐到您计划去的分行
d 提交自。颠覆不
代表任何合理或
实用的时尚;所以用户使用
Subversion 无法看到任何合并
你已经做到了。此外,如果你合并
或者从 git 分支中拉取
SVN 分支的镜像,dcommit 可能
提交到错误的分支。

I may be mistaken but my understanding is that git-svn cannot be shared with an upstream git repo only a subversion one.

I totally hosed my git trying to do what you are trying to do, pull from a remote git repo then push to a subversion one.

What I now do is use git to do my SCC, and I copy files into a subversion only controlled local tree and then check that into subversion.

I wrote a ruby script which does the sync between the local git working tree and the local subversion one. It only copies changed files and only the files I care about. Then I do a normal svn ci from the subversion working tree.

Ok I found the source of my understanding here... http://git-scm.com/docs/git-svn under the heading 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文