Git Svn

While the dialogue can go on as to what to use for version control system, central or distributed, the truth is the whole developer community is inclined towards Git.

If you are a Git user, chances are you come across teams, who still uses Svn. Never to worry though, since Git has native support for Svn. So basically, while all of the team will be using Svn, you can still use Git and work on the same repository as the team, with the added power of Git.

My often used commands to work with Svn through Git are below,

git svn init https://svn.repo.org/dev/trunk/
git svn rebase (or git svn fetch)
git svn dcommit

Basically, once you have your repository locally, everything else is plain Git.

git branch myLocalDev
git checkout myLocalDev
git add .
git commit -m 'my comment'
git checkout master
git merge myLocalDev
git svn dcommit

Below is a description taken from here, which makes it clear as to what to do when Svn is updated and you need to update the local repository before pushing your update to the central repository.

Solve git-svn rebase problems

Put aside your changes using the command :

 git-stash 

Update your working copy using :

git svn rebase 

Take back your changes typing :

git-stash apply 

Clear “the stash” typing :

git-stash clear 

Hope that helps someone out there.

Posted from WordPress for Android through my “HTC Wildfire”.