简体   繁体   English

无法使用git svn推送到SVN存储库

[英]Can not push to the SVN repo using git svn

I'm going to push new changes to the SVN repo, which was not modified after the last git svn dcommit . 我将对SVN存储库进行新更改,该更改在上次git svn dcommit之后未被修改。 I have 4 commits on top in my local version since the last push to the repo. 自上次推送到仓库以来,我在本地版本中有4个提交。 And now I'm always getting this error, when trying to do git svn dcommit again: 现在,当git svn dcommit再次尝试执行git svn dcommit时,总是遇到此错误:

ERROR from SVN:
Connection reset by peer: Can't read from connection: Connection reset by peer
W: 30d2c8bdab2d4cdd860b6ba1b45db55967232d1c and refs/remotes/git-svn differ, using rebase:
:040000 040000 bcb0b926dcd6608b8f243578e44ff0ab32457e32 2040ef070e43df814825c9a9c7708741a3395c9a M  android
:040000 040000 d453457cac2fd97f7ff92bfa849f73edb19ab41d 5b8dd84f1bcf9d136cd410c238750965b3615787 M  ios
Current branch svn-3 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.

There are no any messages about conflicts. 没有关于冲突的任何消息。 git svn rebase returns: git svn rebase返回:

Current branch svn-3 is up to date.

Why does this happen and how can I fix that? 为什么会发生这种情况,我该如何解决?

I could fix this strange bug using next steps: 我可以使用以下步骤修复此奇怪的错误:

  1. git reset --soft refs/remotes/git-svn to return local repo's state to the last successful commit which was updated to the remote SVN repo. git reset --soft refs/remotes/git-svn将本地存储库的状态返回到上次成功提交,该状态已更新为远程SVN存储库。

  2. Looking in git reflog show we can find the last working commit (its hash) with actual changes and apply them again using git checkout and then commit them again. 查看git reflog show我们可以找到具有实际更改的最后一个工作提交(其哈希),并使用git checkout再次应用它们,然后再次提交。

After that I was able to do git svn dcommit successfully without any errors. 之后,我能够成功完成git svn dcommit而没有任何错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM