Push an existing git repository to an existing SVN repository

I have been asked for a school project to submit my work by pushing it to an existing SVN repository. It is an existing repository with some files already there. I have no need for these files or the previous commits.

I have been working on my assignment with a git repository on my. I would like to push my work to the SVN repository without losing any history. How can I do this?

  • Git: show more context when using git add -i or git add -e?
  • How to merge a single commit from a down-stream branch in Git
  • Git pull the last push that was done
  • How to share Android Studio modules between projects with Git
  • Cloning a read-write github repository using TortoiseHg
  • Why did Git and Mercurial use SHA1
  • Where does the .gitignore file belong?
  • What's the difference between ~ and ^ in git
  • Is Git ready to be recommended to my boss?
  • Public key accepted with SSH, fails with git
  • Git interactive unstage
  • How to PR and merge again after reverting PR using Github Revert Button
  • 2 Solutions collect form web for “Push an existing git repository to an existing SVN repository”

    I would do a mix. That is, first clone the svn with git svn. Then in this new repository, you merge your work from your current git repository.

    $ git svn clone http://svn.example.com/project/trunk
    $ cd trunk
    $ git checkout -b mywork
    $ git pull /path/to/current/work/repository/.git master

    Now you have your work in the mywork branch in the clone from subversion. Time to merge and push.

    $ git checkout master
    $ git merge mywork
    $ git svn dcommit


    You can, as a pre-requisite ensure that all your changes in git have been applied or merged into the master branch.

    Then you can run git-svn rebase to merge any updates from svn and finally git-svn dcommit to commit changes.

    There is a detailed explanation here – cf – http://www.viget.com/extend/effectively-using-git-with-subversion/

    Git Baby is a git and github fan, let's start git clone.