简体   繁体   中英

Unable to svn rebase after doing git lfs migrate

I've been migrating a Subversion codebase to Git. All went well and I git svn clone(d) the repo and then git lfs migrate(d) the large and binary files. The repo looks fine from the Git side but I now cannot git svn rebase ...

$ git svn rebase Unable to determine upstream SVN information from working tree history $

I've tried various suggestions from the web on solving this problem but they seem to have no effect. Any suggestions? Can I reset the Subversion/Git info? Should I have git lfs install(ed) before doing the git lfs clone ?

The reason git svn indexing is broken when using git lfs import is that the later rewrites the Git repository history (unless the --no-rewrite option is given).

If using the --no-rewrite option is viable to you (that is: you can handle keeping the big files in the Git repository history, only removing them from future commits), then maybe it's the easiest way to go.

On the other hand, if you must keep those large binary files away from your repository storage entirely, there must be no commit in its history that adds those files directly to Git. Therefore, you must keep using the plain git lfs import to rewrite all the commits created by git svn clone/fetch and redirect those files to the LFS. After running the git lfs import , you will need to regenerate the git-svn rev_map to map the new commits in the rewritten Git history to the SVN revisions they mirror. I don't know if there is an easy way to do this, but you may have a look at the code in https://github.com/Eloston/git-svn-lfs to have an idea.

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