【问题标题】:Trouble pushing from git to subversion using git-svn使用 git-svn 从 git 推送到颠覆的问题
【发布时间】:2011-08-12 16:05:45
【问题描述】:

我正在尝试将现有的 git repo 推送到 svn。

herehere 描述了一些解决方案。 这就是我正在做的:

1.创建git repo:

$ mkdir /blabla/git_repo
$ cd /blabla/git_repo
$ git_init
$ touch hello.c
$ git add hello.c
$ git commit -m "init"

2.创建svn repo:

$ svnadmin create /blabla/svn_repo
$ cd /blabla/svn_repo
$ vim conf/*
... making initial configuring ...
$ svnserve --daemon --root /blabla/svn_repo/

所以,现在我有了纯 svn 存储库和现有的 git 存储库。

3.将git推入svn

$ cd /blabla/git_repo
$ svn mkdir --parents svn://localhost/GIT/trunk -m "git import"
$ git svn init svn://localhost -T GIT/trunk
$ git svn fetch
Error from SVN, (220001): Item is not readable: Item is not readable
$ git branch -av
* master 54ab8bf init

所以,SVN 分支没有出现!

如果在第 3 步我尝试这样做:

$ cd /blabla/git_repo
$ svn mkdir --parents svn://localhost/GIT/trunk -m "git import"
$ git svn init svn://localhost          <--  **no "-T" flag here**
$ git svn fetch
Authentication realm: <svn://localhost:3690> 1d926320-a80a-43d5-9e77-9dc2a43fc4f0
Password for 'arsen': 
W: +empty_dir: GIT/trunk
r1 = 8d3e31cf67f29846660ef20faf3454005101e012 (refs/remotes/git-svn)
$ git branch -av
* master          18cbfbd init
  remotes/git-svn 8d3e31c git-svn-id: svn://localhost@1 1d926320-a80a-43d5-9e77-9dc2a43fc4f0

然后一切正常,除了我不能将 git 存储库推送到 GIT svn 项目中,我只能将它推送到 svn root。

那么,我做错了什么?

【问题讨论】:

    标签: git svn git-svn


    【解决方案1】:

    我发现了问题。

    虽然 svnserve.conf 中有 "anon-access = read" 字符串,但我不得不手动将 "* = r" 添加到 svn authz 文件中。现在它可以工作了,但对我来说没有意义。

    【讨论】:

      【解决方案2】:

      在您的 SVN 树中添加一些内容,然后重试。 (您可以稍后在 svn 中通过转储/加载删除它)

      【讨论】:

      • 我已将这些文件添加并提交到 SVN 中:/GIT/trunk/1、/GIT/2、/3。我再次删除并创建了 git 存储库。同样的故事。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-12
      • 2011-12-27
      • 1970-01-01
      相关资源
      最近更新 更多