开发者

How to resync git with svn tree?

Background

I'm adding some feature开发者_运维百科s to a project that uses subversion - I'm using git-svn to clone it to my local repository, git-svn rebase to keep with the recent changes in the official trunk and keep the history linear.

Recently I've forgot myself and made a few merges which messed my rebasing - long story short I needed to spend some time with cherry-pick to make the history linear again. After that 1 rebase went fine, but now trying to make git-svn rebase shows conflict between subversion commits from 2008 (about 700 commits back) even though history seems to be linear.

Question

  1. Is there a way to rebuild / resync my git repository with svn trunk?
  2. If I clone my git repository on a different computer (without .git/svn folder) - is it possible to rebase it with the svn, knowing the repo url and last rebased revision?


You can reset your branch to a commit that is definitely sync-ed (some old one) and then do a rebase to synchronize.

To save the changes made locally, you might want to branch before (and cherry-pick the necessary changes from this new branch afterwatds)

git branch branch_with_my_changes
git reset --hard very_old_commit_that_is_synced
git svn rebase
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜