简体   繁体   中英

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 . I have 4 commits on top in my local version since the last push to the repo. And now I'm always getting this error, when trying to do git svn dcommit again:

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:

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.

  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.

After that I was able to do git svn dcommit successfully without any errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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