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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:20:11+00:00 2026-06-14T10:20:11+00:00

i have a git repository which is my development Repository. I need to upload

  • 0

i have a git repository which is my development Repository. I need to upload all changes on a weekly base to an svn repository – but I don’t want to expose my git-commit-history. In other words: I explicit want to lose the history. All changes in the git repository for the given week need to be squashed to one single svn commit.

Example for one week:

Git:

commit 1 "fixed y"
commit 2 "added feature x"
commit 3 "foo"
commit 4 "fixed n"

SVN:

commit 1 "changes from this week"

Ideally it should be done by a small shell or python script which is started automatically via cron job.

I have the following variables:

LOCAL_PATH=/tmp/git-svn-bridge/
GIT_DIR=git_repo
SVN_DIR=svn_repo

GIT_REPO_URL=git://git@my_git_server
GIT_REPO_NAME=my_git_repo
GIT_REPO_BRANCH=master

SVN_REPO_URL=svn://my_svn_server
SVN_USER=FIXME
SVN_PASS=FIXME

Any ideas?

Thanks for reading!

  • 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-14T10:20:12+00:00Added an answer on June 14, 2026 at 10:20 am

    Here’s the general idea – use git archive to export and then rsync -a --delete to update the svn working copy. Something along the lines of:

    #!/bin/bash -xue
    
    gitdir='/path/to/git/repo-clone/'  
    gitbranch='master'
    
    svncodir='/path/to/svn/svn-checkout' 
    svnrepo='file:///tmp/svnrepo'  # no trailing slash
    
    # if svn checkout doesn't exit
    [[ ! -d $svncodir ]] && svn co $svnrepo $svncodir
    
    # if svn checkout is pointing to a different repo
    if svn info $svncodir | grep -qF "URL: $svnrepo"; then
      rm -rf $svncodir
      svn co $svnrepo $svncodir
    fi
    
    tmpdest=$(mktemp -d)
    git --git-dir $gitdir/.git archive $gitbranch | tar -x -C $tmpdest
    
    cd $svncodir
    svn update
    
    # sync our temporary dir with the current svn checkout
    rsync -av --delete --force --exclude '.svn' $tmpdest/ .
    rm -rf $tmpdest/
    
    # svn add new or modified files
    svn add . --force --no-ignore
    
    # remove missing ones (whitespace safe, unless you have
    # files with 5 spaces in them)
    svn status | awk -F' {5,}' '/!/ {print $2}' | xargs -I'{}' svn rm '{}'
    
    svn status 
    svn commit -m "changes from this week"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Git repository which has a master branch. Now I want to
I have a git repository which tracks an svn repository. I cloned it using
We have a git repository which contains source for a few related Java WARs
I have a Git repository which I have started to develop on master branch
I have just one cs file in my repository which Git seems to think
I have a git repository that I'm trying to delete all files and folders
I have a git repository I originally used with msysgit , but now I've
I have four branches in my git repository, which is managed using GitHub: Production
I have an SVN repository which was renamed from Project to Project v1. I
Hi have a repository checkout (SVN) which has been heavily modified by a team

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.