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
- Is there a way to rebuild / resync my git repository with svn trunk?
- 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
精彩评论