【问题标题】:Unable to determine upstream SVN information from HEAD history in some of git-svn commands在某些 git-svn 命令中无法从 HEAD 历史记录中确定上游 SVN 信息
【发布时间】:2011-11-24 06:42:23
【问题描述】:

git svn 有问题

对于这个,在尝试git svn dcommit时发生

Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty. at C:\Program Files (x86)\Git/libexec/git-core\git-svn line 780.

git svn info 也有问题,它显示相同的错误消息。

我尝试了很多方法作为另一个主题,但它从来没有奏效。 :(

我也已经尝试过git fsckgit svn rebase -l

我的存储库大约有 20,000 个修订版。我从 http://localhost 获取,它从原始 url 同步,然后,我将 url 更改为原始 URL(在 .git/config 中),更改后我可以毫无问题地运行 git svn fetch。之后我关注this blog

问题依然存在。

【问题讨论】:

  • 没有。没有帮助。我在最终版本中同时使用 git 和 subversion。 TortoiseGit 1.7.4.0,git 版本 1.7.7.1.msysgit.0,TortoiseSVN 1.7.1,Build 22161 - 64 位,2011/10/21 22:51:59 Subversion 1.7.1,
  • 检查一下 Git 是否支持 SVN1.7+ 会很有趣,或者如果可以的话,降级到 SVN1.6+ 是否不会产生更好的结果。
  • 据我所知,有多种可能的原因可能导致此错误消息,包括git svn 中的现有错误。在您的情况下,从 localhost 获取的不规则过程可能是罪魁祸首,因为可能有部分配置仍指向 localhost 地址
  • 博客条目中的程序对我有用(SVN 1.6,git 1.8)。拯救了我的一天!

标签: git git-svn


【解决方案1】:

我有这个使用原因。

我在 Git ma​​rcusproject 上有我的项目。

对于某些策略,我必须同时管理 SVN 和 Git,所以我决定使用 git svn。

Git svn 从 SVN 开始工作,对我来说这是一个问题,因为我来自一个 git 项目。

所以

  • 从 Git 开始,我将项目提交到 my_svn_repo_url
  • 然后在一个新文件夹中运行:

    git svn clone my_svn_repo_url (注意:在 git svn clone 之后你必须再次添加遥控器)

    git 远程添加源 git@myurlgitrepo:/path/git/marcusproject.git

现在如果我运行

git svn info

一切正常。

    marco$ git svn info 

Path: 
 URL: http://myurl/svn/url/branches/project Repository 

Root: blablabla Repository UUID: 2e790b0d-f755-41c8-864a-d7ceaa3670a7 

Revision: 36 

Node Kind: directory Schedule: normal

 Last Changed Author: author 

Last Changed Rev: 36 

Last Changed Date: 2015-04-16 12:54:19 +0200 (Gio, 16 Apr 2015)

如果我切换到一个已经存在的 git 分支 运行 git pull origin mybranch 并且运行 git svn info 我收到此错误

Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty.

但是如果我从新的 master 开始创建我的新分支 git checkout -b 新分支 一切正常。

所以:

  1. 将所有提交推送到 git

  2. 迁移到 git svn(git svn 克隆)

  3. 忘记在“git svn clone”之前创建的所有分支

  4. 从新的 master 开始创建新的分支

你永远不会看到那个错误。

享受

【讨论】:

    猜你喜欢
    • 2011-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-22
    • 1970-01-01
    • 1970-01-01
    • 2012-09-19
    • 1970-01-01
    相关资源
    最近更新 更多