【问题标题】:Error rebaseing/updating a git-svn repository错误变基/更新 git-svn 存储库
【发布时间】:2011-03-20 09:44:11
【问题描述】:

希望这不是重复,我没有找到任何关于如何更新 git-svn 存储库的简明信息。我使用 git svn clone 将 SVN 存储库导入 git。然后,在做了一些提交之后,我想对原始的 SVN repo 进行 rebase。

C:\Work\osqa>git svn rebase
Migrating from a git-svn v1 layout...
Data from a previous version of git-svn exists, but
        .git/svn
        (required for this version (1.7.3.1.msysgit.0) of git-svn) does not exis
t.
Done migrating from a git-svn v1 layout
forum/views/readers.py: needs update
update-index --refresh: command returned error: 1

当我第二次重复 git svn rebase 命令时,我得到了最后一条消息的尾部:

C:\Work\osqa>git svn rebase
forum/views/readers.py: needs update
update-index --refresh: command returned error: 1

我不确定错误消息的含义。你能帮忙解决吗?

【问题讨论】:

    标签: svn git git-svn


    【解决方案1】:

    如果我没记错的话,这意味着该文件存在未提交的更改。 git status 的输出是什么?

    【讨论】:

    • 是的,但是您对它所抱怨的文件进行了未提交的更改。提交或隐藏它们,然后重试。
    • 这确实是(部分)问题。我刚刚意识到 git-svn 不会保留它的元数据。我想我一直在制作一个根本没有 SVN 元数据的新副本。 stackoverflow.com/questions/5368819/…
    • 您可以在 git 中推送提交,而无需每次都执行 git stash。因为在我看来 git svn dcommit 本质上是 git push 在我看来 git stash 不应该是必要的..
    【解决方案2】:

    如果您在 Windows 系统上工作并且git status 的输出返回“no changes added to commit”,则可能是 FAT 文件系统上的文件属性有问题。尝试执行git config core.fileMode false

    autocrlf 设置也可能导致此问题。

    【讨论】:

    • 发生在一台具有双引导、Fedora + Windows 以及我创建为 NTFS 以便我可以在两个操作系统之间共享它的分区的机器上。
    【解决方案3】:

    看起来您有未提交的文件更改。

    git status
    # if you see pending changes, you can do multiple things
    
    1. 把它们藏起来,拉出最新的然后重新访问它们。

      git stash git svn rebase git stash pop

    2. 如果打算进行更改并且您愿意提交。

      git add <file> git commit -m '<commit message>' git svn rebase

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多