Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are pros and cons of using git-svn?

Tags:

git

svn

git-svn

I'm tired of subversion, it keeps corrupting its own repository. As I was for a long time curios of git and always wanted to try it out, I've decided to give it a go and use git-svn. But reading through documentation I realized that you can't use much of git awesomeness with it. You can't use git-pull, it is not recommended to create local branches and there are tons of limitations. Looks like it is not much better than using subversion directly. Or is it? What pros and cons git-svn has over just plain svn?

PS. I'm sorry but I'm not asking you how to fix my subversion repository, I don't care that much. Deleting all .svn and checkout in the same directory overnight works fine. I just was wondering what benefits could git-svn bring to the table.

like image 670
vava Avatar asked Aug 21 '09 07:08

vava


2 Answers

Pros:

  • Everything that Git is good for:
    • Network-free access to all old commits
    • Commit and rebase in Git (again, network-free) and then git svn dcommit to push all the changes to SVN for a nice clean commit
    • Cheap local branching (not sure why you say this doesn't work so well)
  • Don't have to deal with SVN so much :)

Cons:

  • Much better workflow if you already know both Git and SVN (i.e., not so good for new source control users)
  • Will confuse anyone else if they look at what you're doing
  • Some features of SVN (such as svn:keywords) not available/convenient
like image 120
Will Robertson Avatar answered Sep 23 '22 19:09

Will Robertson


These are the spesific pro and con using git-svn. So it's not really about the git itself.

Pro:

The tendency of people using svn is to commit big changes all at once, because you need to commit over the wire. This approach can be bad because sometimes the changes might not related with each other. e.g: You can have changes with bugfixes and changes for new feature committed on one changeset. With git I can commit as often to my local git repository (especially when I'm not connected to a network) and have a changeset as small as possible. I then commit to svn (using 'git svn dcommit') when the whole big changes is ready.

Con:

The con of having svn as the remote repository is merging, especially when there are conflicts. It can be painful sometimes. I use IntelliJ as my IDE and to resolve conflicts, I have to go to command line to fix it. Knowing that I encounter this problem often, I have documented it and now it doesn't become a big deal anymore for me.

like image 22
Joshua Partogi Avatar answered Sep 21 '22 19:09

Joshua Partogi