gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 01:14:05 25 4
gpt4 key购买 nike

上周,在周末离开城镇之前,我对本地分支机构进行了一些更改。今天早上我想将所有这些更改提交到公司的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com