Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I sync a git repository to subversion?

Tags:

git

svn

git-svn

We use several open source libraries that are hosted on github. I want to be able to clone the git repositories and basically push them into our local subversion repository so I can start a CI build internally for them.

How do I set up the connection to the svn server in a git repository that I cloned from github? I understand how to clone out of subversion.. but how do I push a new project into it?

like image 201
NotMyself Avatar asked Feb 24 '26 22:02

NotMyself


1 Answers

You'll have to install svn as well as git, unfortunately.

  1. In svn: Create the initial svn repository with a minor initial commit, e.g. of a README.
  2. In git: Create a remote branch in git corresponding to that svn repo.
  3. Create a tracking branch for that svn branch as if the svn repo were your source.
  4. Rebase your git commits from your master branch onto the tracking branch.
  5. git svn dcommit (to send the new commits in the branch into svn)

The git-svn bridge doesn't cover all the edge cases, like pushing a git repo to an svn one or adding svn ignore properties, so sometimes you end up having to work with a svn repo copy directly in addition to the git-svn, I've found.

like image 88
Kzqai Avatar answered Feb 27 '26 23:02

Kzqai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!