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 8202325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:08:35+00:00 2026-06-07T07:08:35+00:00

I have a situation where I am using gitHub to manage changes to a

  • 0

I have a situation where I am using gitHub to manage changes to a repo I pulled from an open source project that uses svn.

Everything has been all well and good until I realised that in using sed to change stuff, I have changed the svn tracking files. There are just too many to manually fix.

I basically have this problem on a grand scale.

I need these to be intact so I thought I’ll do the following:

  1. Create a new local working copy of the pristine svn based code.
  2. Recursively delete all the non “.svn” folders in this tree. I.E., get to a situation where I have the project tree with only “.svn” folders and their contents in it.
  3. Recursively delete all the “.svn” folders in “gitHub” tree.
  4. Copy across the “.svn” folder to the “gitHub” tree

Three questions:

  • Is this advisable?
  • If not, any suggestions on how to recover the svn stuff?
  • If on the right track, how do I achieve Step 2? I.E., recursively
    delete everything but the “.svn” folders? I have found a lot ofstuff
    on Google to do Step 3 but this is the flip of those.
  • 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-07T07:08:37+00:00Added an answer on June 7, 2026 at 7:08 am

    Found that my originally proposed approach has worked just fine.

    Steps Taken

    • create ‘svnrepos’ equivalent of ‘gitrepos’ to have two sub
      directories to hold actual repo and pristine file set:

    mkdir /home/build/REPOS/svnrepos && mkdir /home/build/REPOS/svnrepos/repos && mkdir /home/build/REPOS/svnrepos/files

    • create local svn repo:

    cd /home/build/REPOS/svnrepos/repos && svnadmin create project_name

    • grab pristine source files. this will untar as ‘project_name’:

    cd /home/build/REPOS/svnrepos/files && wget http://site.net/project_name.tar.gz && tar -xzf project_name.tar.gz

    • import pristine source files into the new local repo:

    svn import /home/build/REPOS/svnrepos/files/project_name file:///home/build/REPOS/svnrepos/repos/project_name -m "Initial import of project_name"

    • rename existing ‘GIT_Project’ folder as we will use this name for a
      temporary svn working folder:

    cd /home/build/REPOS/gitrepos && mv GIT_Project GIT_Project_git

    • create new ‘GIT_Project’ folder and checkout svn repo into this:

    mkdir GIT_Project && svn co file:///home/build/REPOS/svnrepos/repos/project_name /home/build/REPOS/gitrepos/GIT_Project

    • recursively delete every file in the new temporary svn working folder
      that is not under a ‘.svn’ directory tree. Leave folder structure
      intact:

    cd /home/build/REPOS/gitrepos/GIT_Project && find . -type f | grep -v '.svn' | xargs rm -f

    • recursively delete every ‘.svn’ folder in the original git version
      folder:

    cd /home/build/REPOS/gitrepos/GIT_Project_git && rm -rffind . -type d -name .svn`

    • create a tar file from the truncated temporary svn working folder:

    cd /home/build/REPOS/gitrepos && tar -czf svn.tgz GIT_Project

    • remove the temporary svn working folder:

    rm -fr GIT_Project

    • rename the git version folder back to its original name:

    mv GIT_Project_git GIT_Project

    • unpack the truncated temporary svn working folder tar file to add
      updated ‘.svn’ folders and contents to the git version folder:

    tar -xzkf svn.tgz

    • get the svn status of the git version folder. it will show removed
      files or folders with a ‘?’ prefix and missing files or folders with
      a ‘!’ prefix. save the list to an external file and use find and
      replace to change these to “svn add” and “svn delete” respectively.
      remember to skip files and folders that should not be added to
      svn:

    cd GIT_Project && svn status

    • use the amended svn status output to update svn:

    svn add fileORfolder_1 && svn add fileORfolder_2 ... && svn add fileORfolder_n

    svn delete fileORfolder_1 && svn delete fileORfolder_2 ... && svn delete fileORfolder_n

    svn commit -m "Realign svn and git"

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

Sidebar

Related Questions

I have situation where a 3rd party open source product I am using is
I have a situation in my project where I have to keep using a
Using this file as source, I have a situation where I need to retrieve
The Situation (Ignore this it is boring): I have reports that I created using
Here is my situation. I have an app that is composed almost entirely using
i have a strange situation: I'm using jpa/hibernate to get rows from a mySql
I have a situation about in using ListView and found that if I set
I have a situation where I will be using a repository pattern and pulling
I am using SQL Server 2008 and I have a situation where I have
I am using SQL Server 2000, I have a situation where I am copying

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.