Rodrigo's answer brings several advantages of Git, so my answer goes more as a complement, trying to cover some other points.
I understand that Git ends up being the default option even for individual projects for a few reasons:
Experience . Probably the developer has already worked on a project that uses Git. And if you have not worked, certainly worth learning because this knowledge will certainly be used in your professional career when participating in new projects or working in other companies. The same can not be said of other versioners.
The "stash" . It is very simple to save for later that code that you (you think) will need later using the command
git stash and return with it all with
git stash pop . I do not know if other versioners have something similar, but it's a very useful feature.
- Staging Area : If you are a person who likes very well organized things, you can use the Staging Area Git to separate in different commits the various changes made in the code, without worrying about whether another developer is finding it too exaggerated: )
There are two more points that I will explain below: Easy to create a repository and Understanding facility .
About the ease of creating a repository , for me there is nothing simpler than getting into the root directory of your solo project and doing:
And immediately have a completely functional Git repository for your solo project, and you can take advantage of all the tools that Git offers.
Now imagine the scenario of a developer who has never seen Git in his life.
Normally many end up thinking SVN as an alternative. But perhaps putting an SVN repository to work is not as simple as simply learning how to use Git.
That said, let's face it:
Objectively, what is really decisive in choosing to switch SVN from Git in an individual development scenario? Which killer feature can set this choice? Remember that some of the advantages of Git do not apply to this scenario.
For the reasons I explained above, it may be more difficult to put an SVN to work than simply create a local repository and learn Git. And if you already know Git, I see no advantage in using SVN in most scenarios.
Is there an advantage in this? Am I going to miss anything significant with the exchange?
Now, finally, I'll explain what I said about Git's ease of understanding . Maybe the Git commands are not very friendly, but their inner workings are much clearer (at least for me).
My experience with SVN is old (mid-2011). At the time I was able to understand much better how Git worked than how SVN worked, and this in a very short interval of time. With Git you can simply think of your repository as a great graph, which makes it easy to understand various repository scenarios in a visual way.
I'll give you an example of how SVN can be confusing and, in advance, I beg your pardon for not giving more details because it has been a long time since this happened to me.
In SVN, sometimes we needed to take individual revisions of a branch from any task and move on to another branch of release . After that, we would merge the task branch into the release branch and SVN simply ignored in the merge all job revisions prior to that individual revision. I know this is a merge behavior, but the fact that SVN allows selecting a range of revisions (or revisions individually) in this merge process left the situation quite confusing. / p>
When I finally came to understand how Git was simpler in this scenario, using
cherry-pick , and making clear the difference between it and merge or rebase , I passed to sympathize with the tool:).