简体   繁体   中英

Git Branches after SVN Migration

I migrated my group's project from SVN to github using git-svn. The history was preserved correctly, but the SVN branches were committed at the top level directory of master instead of into git-branches. Prior to merge, these branches were in sync with the 'trunk'.

So the github directory structure looks like:

trunk/
branches/
        *branch1
        *branch2
        etc.

I would like to move each of the sub-folders in the branch folder into its own git branch and then remove them from the master. But I am not sure if I need to create a branch by itself, and then merge the folder in and then delete the folder? Or rebase with the master?

The original command that I used to migrate the repository was:

git svn clone --stdlayout --no-metadata --authors-file=users.txt svn://path/to/my/SVN

But this still does not get the branches correct. Would anyone be able to help me with this problem? Thank you.

Use -s/--stdlayout option when doing git svn init or clone , eg

 git svn clone -s <path to the svn folder containing trunk and branches>

this way git-svn will recognize your trunk as master and your svn branches as git branches.

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