Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting Git repository into SVN with SubGit

Tags:

git

svn

subgit

I am using SubGit to synchronize Git and SVN repos. When cloning a remote Git repo I want to preserve all the history of that repo. The steps I currently follow allow me to copy the history of the master branch only:

svnadmin create svn_repos
subgit-1.0.0-EAP_1381/bin/subgit configure svn_repos
subgit-1.0.0-EAP_1381/bin/subgit install svn_repos
git clone svn_repos gitRepo

cd gitRepo/
git remote add -f newRemote git://127.0.0.1/gitRepo
...
From git://127.0.0.1/gitRepo
 * [new branch]      FirstProductionTag -> newRemote/FirstProductionTag
 * [new branch]      SecondProductionTag -> newRemote/SecondProductionTag
 * [new branch]      ThirdProductionTag -> newRemote/ThirdProductionTag
 * [new branch]      bugfix     -> newRemote/bugfix
 * [new branch]      bugfix2    -> newRemote/bugfix2
 * [new branch]      master     -> newRemote/master

git merge -s ours --no-commit newRemote/master
git read-tree --prefix=foo/bar/ -u newRemote/master 
git commit -m "Merged new Remote into subdirectory /foo/bar"
git push origin master

How can I merge the changes from bugfix and bugfix2 branches at the same time? Thanks!

like image 865
Evgeny Arbatov Avatar asked Jun 15 '12 09:06

Evgeny Arbatov


People also ask

Does Tortoise SVN work with git?

TortoiseGit Is an easy to use gui-based git client for windows. With the included git-svn module it is also possible to use subversion repositories. If you use git locally, you can use all git features like stashing and local branches but still use the subversion repository.

What is SubGit?

TMate SubGit is a tool for teams that migrate from SVN to Git. It converts SVN repositories to Git and allows you to work with both systems simultaneously. GET STARTED.

Can git be used for SVN?

The git-svn tool is an interface between a local Git repository and a remote SVN repository. Git-svn lets developers write code and create commits locally with Git, then push them up to a central SVN repository with svn commit-style behavior.


1 Answers

If your goal is to get Subversion repository from remote Git repository and keep both repositories synchronized, consider do the following:

$ svnadmin create svn_repos
$ git clone --mirror git://127.0.0.1/gitRepo svn_repos/.git
$ subgit-1.0.0-EAP_1381/bin/subgit install svn_repos
like image 167
vadishev Avatar answered Oct 11 '22 09:10

vadishev