我使用 将 SVN 存储库转换为 git
git svn clone --stdlayout --authors-file=authors.txt --no-metadata svn://svn.foo.com
出于某种原因,这给了我一个看起来像裸存储库的东西。只有一个 .git
目录。在这个克隆的存储库中,我想 checkout 。由于 git checkout
没有用,我跑了
git reset --hard
这是正确的方法吗?它似乎有效,但听起来很可怕。然后我尝试运行
git svn rebase
以便将 Subversion 存储库中的最新更改 pull 入我的 git 克隆中。但是,这没有用。相反,它会产生消息
Unable to determine upstream SVN information from working tree history
有人知道为什么会这样吗?
最佳答案
我相信这是因为我将 --no-metadata
传递给了 git svn clone。这就是git-svn(1)手册页介绍了“无元数据”选项:
This gets rid of the git-svn-id: lines at the end of every commit.
If you lose your .git/svn/git-svn/.rev_db file, git svn will not be able to rebuild it and you won't be able to fetch again, either. This is fine for one-shot imports.
我不是那样读的,但显然使用 --no-metadata
使 git svn 不生成 git-svn/.rev_db
文件。我确实有一个 .git/svn
子目录,但下面没有 git-svn
。
关于svn - 我可以从使用 --no-metadata 创建的 SVN git 克隆执行 'git svn dcommit' 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1577861/