What are the advantages of git over git-svn?

The advantages of using git-svn over git are obvious (svn compatibility), but what are the advantages of git over git-svn?

+7
git git-svn
source share
2 answers

It just means that you have less VCS to manage in your development chain (svn).
In the period of administration:

  • you are left with distributed repositories managed by Git, each of which is autonomous with their full history
  • You do not need to maintain a connection to the central SVN repo.
  • you can organize your backups in different ways (by dragging your data into an open repo backup or by exporting a Git repository via git bundle )

And, of course, you can manage all the benefits of Git over SVN .

+5
source share

git-svn and git use the same functionality locally when running. The difference occurs when sending or receiving changes from a remote repository.

  • Push vs. dcommit.

    Why does git-svn need this separate dcommit command?

    Because the Subversion repository behaves differently than the remote Git: SVN repository always tries to merge incoming changes at the directory level. If one modifies a file that was changed at the same time by another user, SVN rejects the incoming changes with an outdated error. Otherwise, commit / dcommit .

    In contrast, Git push returns an obsolete error when one modifies the same branch / tag, regardless of which files were affected.

    As a result, git-svn dcommit should make sure that the version just installed matches the expected version (some directories can be automatically merged during dcommit ). This means that git-svn always pulls / pulls back the changes that it just posted to the SVN repository.

  • The file is ignored.

    When someone ignores certain files in the working tree and commits this modification, there is no way to send this modification using git-svn dcommit . Thus, there is no way to share ignoring other users of the SVN repository.

  • Git.

    Both Subversion and Git have specific metadata associated with files and directories. Like .gitignore there is no way to share .gitattributes with colleagues.

  • Merge commit.

    Finally, when you try to make dcommit merge, it is likely that some commits will not be sent to the SVN repository at all. This happens when all the merged branch commits have not yet been pushed to the SVN repository.

Most of these git-svn problems are difficult or even impossible to fix. You might consider SubGit , a server-side alternative to git-svn that fixes most of them.

See the SubGit and SubGit vs. Documentation documentation for more details. git-svn .

+3
source share

All Articles