1

How can i repair my git-svn mirror repository? It is set up with git svn init ..., then github remote was added. The cron job is doing git svn rebase && git push periodically.

Everything was fine until upstream somehow "uncommited" several revisions from svn, which already was fetched into my git-svn and pushed to github. Then upstream added some new revisions to svn trunk, reusing revision numbers of "uncommited" revisions, which broke my syncronization process.

When i realized what hppened, i did git svn reset to last valid revision and commited reverse patch into git.

But since then, i can not pull upstream changes with git svn rebase, i have to do git svn fetch && git merge trunk instead, resulting in awful history.

Can i somehow tell git-svn that i will not git svn dcommit anything, that it can forget about that reverse patch commit, so git svn rebase can work like it worked before all this happened?

4

1 回答 1

0

我的调查结果:git-svn 的 rebase 功能并没有什么神奇之处。它只是一个git svn fetch跟随git rebase refs/remotes/trunk和参考更新。就我而言,我所要做的就是将我的本地跟踪分支 ref 移动到从提交中获取的最后一个。

git svn fetch
git log -1 refs/remotes/trunk

给了我最新的 sha1:ed0fa874ca872bc3a0101ee397f611a537e72c2a

git update-ref HEAD ed0fa87
git reset --hard

有用的资源:Pro GIT Book在 git 中可视化分支拓扑

希望,这会帮助某人。

于 2013-06-26T11:49:27.220 回答