Article version: Enterprise Server 2.13

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2019-03-27. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

What are the differences between Subversion and Git?

Subversion (SVN) repositories are similar to Git repositories, but there are several differences when it comes to the architecture of your projects.

Directory structure

Each reference, or labeled snapshot of a commit, in a project is organized within specific subdirectories, such as trunk, branches, and tags. For example, an SVN project with two features under development might look like this:

  sample_project/trunk/README.md
  sample_project/trunk/lib/widget.rb
  sample_project/branches/new_feature/README.md
  sample_project/branches/new_feature/lib/widget.rb
  sample_project/branches/another_new_feature/README.md
  sample_project/branches/another_new_feature/lib/widget.rb

An SVN workflow looks like this:

Git projects are also stored within a single directory. However, Git obscures the details of its references by storing them in a special .git directory. For example, a Git project with two features under development might look like this:

  sample_project/.git
  sample_project/README.md
  sample_project/lib/widget.rb

A Git workflow looks like this:

Unlike SVN, with Git the directory structure remains the same, but the contents of the files change based on your branch.

Including subprojects

A subproject is a project that's developed and managed somewhere outside of your main project. You typically import a subproject to add some functionality to your project without needing to maintain the code yourself. Whenever the subproject is updated, you can synchronize it with your project to ensure that everything is up-to-date.

In SVN, a subproject is called an SVN external. In Git, it's called a Git submodule. Although conceptually similar, Git submodules are not kept up-to-date automatically; you must explicitly ask for a new version to be brought into your project.

Here are some external resources that explain the differences in more detail:

Preserving history

SVN is configured to assume that the history of a project never changes. Git allows you to modify previous commits and changes using tools like git rebase.

GitHub supports Subversion clients, which may produce some unexpected results if you're using both Git and SVN on the same project. If you've manipulated Git's commit history, those same commits will always remain within SVN's history. If you accidentally committed some sensitive data, we have an article that will help you remove it from Git's history.

Further reading

Ask a human

Can't find what you're looking for?

Contact us