Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:13:57+00:00 2026-06-03T16:13:57+00:00

I am trying to convert a slightly messy svn repository to git. I tried

  • 0

I am trying to convert a slightly messy svn repository to git. I tried reading some guides and other SO questions, but get a little lost as to what’s the best way to follow.

The SVN repository has a top-level folder structure with folders, something like:

 |- client
 |- server
 |- website
 |- misc

Most of those folders have the ‘standard’ svn structure: i.e. trunk, branches and tags. Some are just flat folders however.

 |- client
    |- trunk
    |- branches
    |- tags
 |- server
    |- trunk
    |- branches
    |- tags
 |- website
 |- misc

The branches and tags might have the same name between different folders. For example, both client and server folders might have a branch called 1.0.

I managed to convert individual folders using svn2git, and it seems to get the history, as well as branches fine. I can manage to create an individual git repository for each folder. However, I’d like to keep everything in one repository eventually.

What’s the best way to merge those folders (now git repositories) into one, whilst maintaining the branches, tags and history of each folder? Using this approach, I seem to lose both the commit history and the branches from the merged-from repository… Or perhaps I’m just missing some important steps or doing something wrong?

Otherwise, maybe using svn2git on each folder separately is not the best approach to migrate from svn to git?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:13:58+00:00Added an answer on June 3, 2026 at 4:13 pm

    I eventually opted for the approach on this answer.

    Essentially:

    • creating a git project for each sub-folder in the svn repository (using svn2git)
    • creating a new git repository merging all repositories into
    • adding each project (including all branches) as a remote:

      git remote add alpha <url/path-to-alpha-repo>
      git remote add bravo <url/path-to-bravo-repo>
      git remote add charlie <url/path-to-charlie-repo>
      for r in $(git remote); do
        git config remote.$r.fetch \
        "$(git config remote.$r.fetch | sed -e 's.remotes.heads/all.')"
        git config --add remote.$r.fetch \
        "$(git config remote.$r.fetch | sed -e 's.heads.tags.g')"
        git config remote.$r.tagopt --no-tags
      done
      git remote update
      
    • pushing the merged-repository to a remote repository (from now on this will be the ‘official’ repository).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to convert my local SVN repo to Git using svn2git as suggested by
I'm trying convert some decimals to varchar , but they are getting rounded .
I'm trying convert jQuery Data object to JSON string. I tried: $.data(plant).toJSON() JSON.stringify($.data(plant)) but
Trying to convert output from a rest_client GET to the characters that are represented
Trying to convert the following but am having difficulty. Can anyone see where I'm
Im trying to convert unixtime to date but the results im getting are wrong
I'm trying convert xml from one format to other using the XslCompiledTransform in c#.
I'm trying convert a bunch of pictures and videos, but when I convert it
I'm trying to (slightly) improve a script that does a quick-and-hacky parse of some
Im trying to convert some special characters like ä , ö , ü ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.