GIT-SVN:dcommit包含太旧的提交

时间:2014-10-09 19:44:59

标签: git git-svn

我使用git svn并且在提交时遇到问题。

我想把我的工作告知,但我有这条消息(翻译自法语):

ERROR from SVN:
File exists (couche RA): file 'path/to/file.java' already exists
W: 284d23ef86d9fbc510f4ab1423c34aa001d42063 and remotes-repo differ, using rebase:
:040000 040000 3ab05762f438259258d15ac17fddcb9acc35ea30 eb62818521976199c132720aac338a4bae66c84a M  src
Current branch local-repo is up to date.
ERROR: Not all changes have been committed into SVN, however the committed
ones (if any) seem to be successfully integrated into the working tree.
Please see the above messages for details.

所以我做了一个dcommit --dry-run来看看应该是什么dcommited:

$ git svn dcommit --rmdir --dry-run 
Committing to https://svn/xxx ...
diff-tree 5e967cb8b9044381ed8cfb063c0420daf397a52a~1 5e967cb8b9044381ed8cfb063c0420daf397a52a
diff-tree deed0113f3813e914633cc3bf8ee6350ade3959e~1 deed0113f3813e914633cc3bf8ee6350ade3959e
diff-tree c5edfbc97b5a3755d61c8d5115b34b7417c13bcd~1 c5edfbc97b5a3755d61c8d5115b34b7417c13bcd
diff-tree 274bf4d495147b345aecc4723c93e82a9f77f902~1 274bf4d495147b345aecc4723c93e82a9f77f902
diff-tree 0e4824e0a5cc744d18b889f60b3c4db774365201~1 0e4824e0a5cc744d18b889f60b3c4db774365201
diff-tree 73b7956738218772b4660100f905525b073bebb5~1 73b7956738218772b4660100f905525b073bebb5
diff-tree 14dfcef8f3e4fc55a03f22ff0464462b415944ac~1 14dfcef8f3e4fc55a03f22ff0464462b415944ac
diff-tree 588f74cf615bcc6ce30b7a37966c8bbde5311006~1 588f74cf615bcc6ce30b7a37966c8bbde5311006
diff-tree f40434c968f7709656b5ec7c52f05a517a38a9d0~1 f40434c968f7709656b5ec7c52f05a517a38a9d0
diff-tree 399a44448102ebefa00c1b0e8f8d55864e2292ad~1 399a44448102ebefa00c1b0e8f8d55864e2292ad
diff-tree ac6373180e028cbb0ec752e5477965bcd44a885e~1 ac6373180e028cbb0ec752e5477965bcd44a885e
diff-tree c62976cb0bd03c6acde27b3d594aff555609d9f0~1 c62976cb0bd03c6acde27b3d594aff555609d9f0
diff-tree 2455fcb5f835095d60edf25e5d8fa6c9380428b6~1 2455fcb5f835095d60edf25e5d8fa6c9380428b6
diff-tree 990b9a4f07331ce77a93365fd09b38c55ee17acd~1 990b9a4f07331ce77a93365fd09b38c55ee17acd
diff-tree 284d23ef86d9fbc510f4ab1423c34aa001d42063~1 284d23ef86d9fbc510f4ab1423c34aa001d42063

当我记录我的历史时,我可以看到dcommit dos不尊重历史。第一次提交不应该是dcommited(我认为)。 实际上,我认为dcommit应该从deed0113开始,因为deed0113的父节点是我的remotes-repo分支的最后一个公共节点(甚至是我的remotes-repo)。 我还注意到5e967cb8是remotes-repo的父母。 它以图形方式给出:

5e967cb8b --> remotes-repo --> deed0113 --> c5edfbc9 --> and so on --> 284d23ef

我无法理解为什么我的dcommit包含第一次提交。

我很幸运能够在我的控制台中保留最后一次成功的结果。而且我有这个消息,我已经逃避了,因为我不理解它:(

$ git svn dcommit --rmdir 
Committing to https://svn/xxx ...
    M   path1/to/file1.java
    M   path2/to/file2.java
    M   path3/to/file3.java
Committed r7735
W: f8f8d3da4a9401f847668c392cd3f0632e63573b and remotes-repo differ, using rebase:
:040000 040000 eb62818521976199c132720aac338a4bae66c84a 2d61d69e43a0234a5db5607eb43fe845f9047b88 M  src
Current branch local-repo is up to date.
# of revisions changed  
before:


after:
 f8f8d3da4a9401f847668c392cd3f0632e63573b 
 If you are attempting to commit  merges, try running:
     git rebase --interactive --preserve-merges  remotes-repo
Before dcommitting

我想这与我的问题有关。 有什么想法吗?

感谢您的帮助和大吻。

PS:原谅我的英文

2 个答案:

答案 0 :(得分:0)

我发现了问题:问题来自我的.config文件通过DNS别名引用我的svn repo,而且这个别名可以代表SVN父回购或这个SVN父回购的镜像,具体取决于你在哪里在网络上。似乎git曾经用过父亲的回购,曾经是镜子(也许是因为我的git工作区已被移动)。由于镜子不是最新的,情况导致这种历史不一致。 一旦我在我的git配置文件中修复了所有我的网址都完整名称,问题就会消失。

希望我的解释足够清楚。

答案 1 :(得分:0)

我有一个非常类似的问题,当git svn dcommiting只有一次提交时,其中两个会出现在dcommit diff-tree上:

$ git svn dcommit --dry-run
Committing to http://myUrl/myRepo ...
diff-tree rightCommitHash~1 rightCommitHash
diff-tree randomCommitHash~1 randomCommitHash


$ git svn dcommit
Committing to http://myUrl/myRepo ...
    M       xml/fileThatShouldntBeHere.xml

ERROR from SVN:
Item is out of date: Item 'xml/fileThatShouldntBeHere.xml' is out of date

... {some commit info}

Current branch merge-branch-tmp is up to date.
ERROR: Not all changes have been committed into SVN, however the committed
ones (if any) seem to be successfully integrated into the working tree.
Please see the above messages for details.

我通过删除.git/svn目录解决了这个问题,因为我认为svn修订版没有正确解决。然后我运行了git svn dcommit --dry-run,它制定了svn版本并且有效!