Take a look at the one-developer versioning part of the answer to the question “ Difference between GIT and CVS ” in StackOverflow. Some of these problems still apply to Subversion compared to GIT (or other distributed VCS: Mercurial, Bazaar or less well-known: Monotone , Darcs), even if Subversion is an improvement over CVS.
The following is a list of the differences between GIT over Subversion for a single developer on the same machine (separate account):
Storage setup. GIT stores the repository in the .git directory in the top directory of your project. Starting a new project from an unversioned file tree is as simple as making "git init" in the top directory of your project (and then, of course, "git add."), To add files and, for example, "git commit -m 'Initial commit '' to create the first commit).
In Subversion (in any centralized version control system) you need to set up a central repository (if you haven’t done this before) using "svnadmin create" (well, you only need to do this once). Then you need to import the files into Subversion using "svn import" (or "svn add") ... But note that after the import is complete, the original tree will not be converted to a working copy. To get started, you still need to “svn checkout” create a new working copy of the tree.
Repository and repository metadata. GIT stores both the repository (i.e. information about changes and branches, etc.) and the repository metadata (for example, your identity, a list of ignored files, which branch is currently being checked) in the .git directory in your top directory projects.
Subversion stores the repository in a separate area that you have to put for this purpose and saves the repository metadata (for example, where is the central repository, the identifier used to access the central repository, and I also think that properties like svn:ignore ), stored in .svn in the directory of each directory of your project. (Note that Subversion keeps a blank copy of your order in order to have "svn status" and "svn diff")
Naming versions / version numbers. Subversion uses global revision identifiers in a single version with a number, so you can, for example, refer to r344, revision 344). Subversion also supports several symbolic revision specifications: HEAD, BASE, COMITTED, PREV.
In GIT, each version of the project (each commit) has its own unique name given by 40 hexdigits SHA-1 id; Usually, the first 7-8 characters are sufficient to identify a fix (you cannot use a simple numbering scheme for versions in a distributed version control system, which requires a central authority on numbering). But GIT also offers other types of revision specifications, for example, HEAD^ means the parent element of the current commit, master~5 means 5 ancestors back (in the direct line of the first parent) back from the top commit to the leading branches, v1.6.3-rc2 can mean a revision tagged with v1.6.3-rc2 .
See also Many different revision qualifiers on Elijah Newren's blog.
Easy forking and merging. In GIT, creating and merging branches is very simple; GIT remembers all the necessary information on its own (therefore, merging a branch occurs in the same way as "git merge branchname") ... it should have been because distributed development naturally leads to several branches. GIT uses a heuristic definition of renaming based on affinity, so when merging it can deal with the case where one side renamed a file (and other similar cases related to renaming). This means that you can use the thread branch workflow, i.e. Create a separate function in several steps in a separate function branch.
Branches have an unusual implementation in Subversion; they are processed by the naming convention: a branch is a combination of revisions in the global repository that exist in a particular namespace. A new branch is created by copying an existing set of files from one namespace to another, recorded as the revision itself. Subversion made it easier to create a new branch ... but prior to version 1.5, you had to use additional tools like SVK or svnmerge so that they could merge easily. Subversion 1.5 introduces the svn:mergeinfo , but even then merging is a bit more complicated than in Git; you also need to use additional options to display and use merge tracking information in tools like svn log and svn wame. I heard that it does not work correctly in more complex situations (criss-cross merge) and cannot rename it now (in this case there is even the possibility of silent corruption). See Also (for example) this post on Dmitry Potapov’s GIT mailing list , explaining the alleged use case for svn:mergeinfo and its (current) limitations.
Mark. The GIT tags are immutable , can have a comment associated with them and can be signed using the PGP / GPG signature (and verified). They are created using the git tag. You can reference a revision using a tag name.
Subversion tags use the same path_info namespace as branches (recommended convention svnroot/project/tags/tagname ), and they are not protected from change. They are created using "svn copy". They may have a comment associated with the [commit creating the tag].
Keyword expansion. GIT offers a very, very limited set of keywords compared to Subversion (the default). This is due to two facts: changes in GIT for each repository, not for the file, and GIT avoids modifying files that did not change when switching to another branch or renaming to another point in the history. If you want to insert the version number using Git, you must do this using your build system, for example. following the exaple GIT -VERSION-GEN script in Linux kernel sources and in GIT sources. There is also an 'ident' gitattribute that allows you to expand the $ Id $ keyword to the SHA-1 identifier of the file contents (not the commit identifier).
Both GIT and Subversion do keyword expansion only on demand.
Binary files Both GIT and Subversion handle binary files correctly. GIT binary detection using a similar algorithm used, for example, by GNU diff, unless overridden based on each route using gitattributes. Subversion does this a bit differently by detecting the file type while adding the file and setting the svn:mime-type property, which you can then change. Both GIT and Subversion can do character-string conversion on demand; GIT additionally has the option core.safecrlf config, which prevents and prevents irreversible changes (all CRs for all CRLFs are reversible, mixed CRs and CRLFs are not reversible).
Ignoring files. GIT saves ignore patterns using the in-tree .gitignore , which can be installed under version control and distributed; it usually contains templates for build products and other generated files and in the .git/info/excludes , which usually contains ignore patterns specific to the user or system, for example. ignore pattersn for your editor backup files. GIT templates are applied recursively, unless patter contains a directory delimiter, that is, a slash character '/', then it is bound to the .gitignore file directory; to the top directory for .git/info/excludes . (There is also a configuration variable core.excludesfile , this variable can exist in the configuration file for the user ~/.gitconfig and point to the ignore file for each user).
Subversion uses the global-ignores configuration option (which usually applies to a specific computer or a specific computer user) and the " svn:ignore " property in directories with the SVN version. However, unlike the global-ignores (and in .gitignore ), the templates found in the " svn:ignore " property only apply to the directory in which this property is set, and not to any of its subdirectories. In addition, Subversion does not recognize the use of the prefix ! for a template as an exception mechanism.
Change commits. distributed VCS, such as publishing a GIT publication, does not depend on creating a commit; you can change (edit, rewrite) an unpublished part of the story without inconvenience to other users. In particular, if you notice a typo (or other error) in the commit message or an error in the commit, you can simply use "git commit -amend". (Note: technically, this is a re-creation of a commit, not a change to an existing commit, the modified commit has a different identifier).
Subversion only allows you to modify the commit message after the fact by changing the corresponding property.
Instruments. On the one hand, GIT offers a richer set of commands. One of the most important is git bisect, which can be used to detect the commit (revision) that introduced the error; if your commits are small and standalone, it should be pretty easy to spot where the error is.
Subversion, on the other hand, because it exists longer, may have a wider range of third-party tools and Subversion support in tools than Git. Or at least more mature. Especially in MS Windows.