Git Svn dcommit 错误 - 重新启动提交

标签 git git-svn

上周,在周末离开城镇之前,我对本地分支机构进行了一些更改。今天早上我想将所有这些更改提交到公司的 Svn 存储库,但我在一个文件中遇到 merge 冲突:

Merge conflict during commit: Your file or directory 'build.properties.sample' is probably out-of-date: The version resource does not correspond to the resource within the transaction. Either the requested version resource is out of date (needs to be updated), or the requested version resource is newer than the transaction root (restart the commit).

我不太确定为什么我得到这个,但在尝试提交之前,我做了一个git svn rebase。那“覆盖”了我的 promise 。为了从中恢复,我执行了 git reset --hard HEAD@{1}。现在我的工作副本似乎在我期望的位置,但我不知道如何解决 merge 冲突;实际上,我找不到任何需要解决的冲突。

如有任何想法,我们将不胜感激。

编辑:只是想说明我在本地工作。我有一个引用 svn/trunk(远程分支)的主干的本地分支。我所有的工作都是在本地主干上完成的:

$ git branch
  maint-1.0.x
  master
  * trunk
$ git branch -r
  svn/maintenance/my-project-1.0.0
  svn/trunk

同样,git log 目前在我的本地主干上显示了自上次使用 Svn ID 提交以来的 10 次提交。

希望这能回答一些问题。

再次感谢。

最佳答案

你应该已经创建了一个本地分支,并完成了它的工作,然后当你返回时,你更新 master, rebase 到本地分支, merge 回 master 然后 dcommit。

所以我会尝试复制更改,以备份它们。

从 has svn 同步点创建一个本地分支,将您的更改 merge 到那里。然后回退主分支中的更改,获取, rebase 到分支,从本地分支 merge ,修复所有冲突,然后提交。

$ git checkout -b backup    # create a local backup branch with all your work
$ git checkout master   
$ git checkout -b backup2   # 2nd copy just to be safe
$ git checkout master
$ git reset --hard <this is the revision of the last svn-id> # clean up master to make the svn merge easier
$ git svn fetch    # this should update to the current version on the svn server
$ git rebase master backup  # may get a conflict here, fix and commit
... # after conflict is fixed and commited
$ git checkout master 
$ git merge backup --ff  # merge in your local commits
$ git svn dcommit        # push back to the svn

您可以获得更多信息 here

另一个answer你可能会感兴趣。

git-svn 工作流程文章

Article

关于Git Svn dcommit 错误 - 重新启动提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/629048/

相关文章:

git - 是否可以在没有 git clone 的情况下获取远程 git repo 的提交日志/消息

git - 如何使用 git-svn 只检查主干而不检查分支和标签?

branch - 如何使用非标准 svn 存储库布局的 git-svn 访问 svn 分支?

svn - git merge vs rebase 使用 git svn

git - 从不同的工作目录执行 Git 操作

node.js - 回滚 pm2 部署到特定提交

git - 以编程方式打印 git 修订版并检查未提交的更改

c++ - 编译 x264 的这个 "fixing the build scripts"是什么?

git - 断言失败git-svn checkout

authentication - git-svn 匿名结帐失败并显示 -s