简体   繁体   中英

How to reinitialize a git-svn repository

Following the advice of this tutorial , I cloned an svn repository which did not have the standard layout.

 git-svn clone -s http://example.com/my_subversion_repo local_dir 

The -s is there to signify that my Subversion repository has a standard layout (trunk/, branches/, and tags/.) If your repository doesn't have a standard layout, you can leave that off.

Being completely new to git, I did not realize that simply leaving off the -s option without supplementing the --trunk, --branches, and --tags options would leave me not only with a branchless repository but also with the entire head of the repository checked out (instead of just the head of the trunk).

Is there a way to "fix" my local git repository to behave as though I had created it with knowledge of the svn repository layout? Can I use git-svn init to reinitialize my repository? Because of the length of time involved, I'm hoping to avoid having to reclone from scratch.

This is similar to SO question "Cloning a Non-Standard Svn Repository with Git-Svn" , and I am not sure there is a process to fix the Git repo after that initial clone.

The deep clone is the official way:

git svn clone https://svn.myrepos.com/myproject web-self-serve 
   --trunk=trunk --branches=branches/*/*

But I like the encapsulation provided by svn2git .

Unfortunately, both those solutions require re-cloning from scratch...

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