简体   繁体   中英

How to convert a subversion branch to git

I'm new to git, and we just switch to git. I have a feature branch which is a checkout of the a sub directory in trunk, like trunk/abc. Now I need to create a branch in git, and incorporate all the changes back. We did convert this branch in svn to git, however, since it's not from the root directory of trunk, I can't commit or merge. So here is what I plan to do: create a branch locally: feature_abc, locally, copy all the files from the checked out svn branch abc at the right directory level, then perform a diff and commit. But with 'git status', it seems that git is going to try to commit everything that just got copied, not just the updated files. Or I can do a svn diff from my abc branch to the trunk version we converted to git at, then manually copy updated files over to git feature_abc, but I figure there gotta be a better way of do this. Thanks,

David

You might want to look at following websites.

ProGit
Waaage Blog

Thanks guys for answering my question. I actually didn't want to migrate or re-create git repository from svn. I was trying to put a svn checked out branch from a sub-directory of the trunk back to git (which I don't think git supports sub-directory checkout). What I did was: get a list of changed files by diffing the branch of interest from current trunk(master); create a new branch locally in git; copy the changed files over to the git branch; then commit. I know I'll lose history information, but I can live with that.

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