Git and Subversion Bridge

March 25, 2013 Vishwajyoti Bhattacharjee

Git and SVN BridgeApache Subversion® since its inception in 1999 continues to be the most widely adopted version control software in the majority of open source development projects and a large number of corporate projects. However in the recent years DVCS has started becoming popular and usually have the following properties in common:

• Development History of repository is available locally on disk.
• Operations like commits, viewing history, and reverting changes doesn’t require any network connectivity to server.
• Multiple central repository

Since 2005 Git has evolved as a world’s leading DVCS (distributed version control system). What makes Git distinct from nearly every other SCM out there is its branching model. Git makes merging simple and also you will have “local” benefits (stash, index and speed). Git SVN-Bridge is a bi-directional utility that is bundled with canonical Git written in C and Perl that allows you to have the repository in Subversion and use Git as an SVN client. This let users have access to a local Git repository and use a bunch of Git features like local branching and merging, use the staging area, rebasing while having the repository hosted in Subversion.

Example: A default workflow

Clone the SVN repository as follows

git svn clone REPO_URL

Create a new branch to modify or work on a new feature

git checkout -b new_branch

Work on your newly created branch in the local repository as usual. Once complete, you can switch to the master branch and merge your changes to master.

git checkout master
git merge new_branch

When complete, don’t forget to update your SVN repository, by rebasing

git svn rebase

Now you can commit back to the SVN repository,

git svn dcommit

Using Git-SVN Bridge as an SVN client gives the developer a freedom to use some of the features offered by Git.

For more information on Git and Subversion visit the following link:

Previous Article
New Point Release – VersionOne Mall Map
New Point Release – VersionOne Mall Map

New to our latest point release is a Site Navigator (affectionately called "Mall Map"). Spawned from Versio...

Next Article
Tips on Git: De-fanging ‘Git Push’
Tips on Git: De-fanging ‘Git Push’

Ever had Git commit a branch you didn’t intend? % git co branch-1 % (workee workee workee) % (interrupt) % ...