What is the advantage of subversion compared to git?

As we all know, git is very popular these days because it is very efficient because it has all the history on the local computer, and history extraction can be done without a network. Perhaps for extranet users the network issue is not so important, but git also has other advantages, such as a light branch (I'm still not sure what the difference between it and the svn branch is, why is the git branch light weight)?

I also know that many people still use subversion, why? If git is good, they can switch to git :)

So, can anyone here tell me some of the benefits of subversion?

one more question:

is there anything which can be done by svn, but cannot be done with git? 
+2
source share
5 answers

I advise you to read the article "10 Things I Hate About Git" and the StackOverflow SVN vs Git thread. I also recommend reading this document about Subversion and Git .

While others have already mentioned simplicity (simplicity is a trademark of Apache Subversion ;) BTW) and to clear the workflow as the main advantage of Subversion, I would like to add some other important advantages of Apache Subversion:

  • Improved integration of IDEs and graphical interfaces. You can see the built-in SVN client in most IDEs (or implemented as a plugin). Some of them provide very convenient and intuitive integration of versions with the IDE. Git, on the other hand, does not have a good GUI, except perhaps for the famous GitHub. IDE integration also continues, but the hacking nature of the Git command line does not actually translate to graphical interfaces. You still have to use the command line for something more complex than branching or stretching / clicking.

    BTW, the TortoiseSVN Subversion client can be considered the best version control client available for Windows.

  • Subversion is centralized. In other words, distributed systems are NOT called "next-generation VCSs" (hello, Eric Sank et al.!), They are just spreading. Distribution is another approach that is great for open source projects like Linux Kernel (Git was designed for the Linux kernel, remember?), But has its own drawbacks.

  • Complete change history . SVN supports versioning for directories, renaming, and file metadata. Subversion acts like a time machine with an unchanging history. You can always use the machine to go back in time to check what your date looks like, for example. January 3, 2009.

  • Partial checks. With Subversion, you don’t need to get the full repository clown. You can check a specific branch or trunk of your project. Moreover, you can get any subtree of your repository. Significantly minimizes the traffic required to begin work on the task. If you already have a working copy, switching to another branch or shelf instantly (if you have the ability to connect to a remote repo, obviously).

  • Lock support . Subversion supports a version model for locking-modification-unlocking . Git is not. This can be really useful if you have files that are not related to the merge. Hello Gamedev! :)

  • Integrated authorization and authentication mechanisms.

+11
source

Simplicity.

Questions like “What is the remote control?”, “Why do I need to change the message?”, “What kind of overflow?” necessary to understand all the features that Git provides, and you need to understand them to really know why Git is so awesome.

But for a designer or any technical person starting with Git, this is really just a headache. Subversion is well known, and its centralized approach makes it easier for all of these people to understand.

You can start working and produce material much faster with Subversion (if you already have an environment;)).

+5
source

Git is about personal power, and Svn is about corporate power (as a great statement).

Git knows that there is no longer a core document that needs to be protected from harm. Rather, there are now many copies that, if not checked by sha1, are more difficult to manage.

Svn knows that people are stupid (but not you and me ;-) and think that knowing who renamed and moved what is important, and that the content can be signed later.

Git allows you to work with scissors, juggle with chain saws and produce your product. Svn offers protective clothing, work instructions and a type of safety.

It's about choosing which leg you want to nail to the floor; -)

+4
source

Git branches are “light” because they are just pointers: git simply points to “host” or “development” or “trunk” or “myfeature” to a specific commit. When you make an update on a branch, the pointer advances. Consider this diagram from git -scm docs, a star resource on this.

git branch pointers

The "master" section of this diagram indicates commit f30ab . In the "testing" branch, the c2b9e commit is c2b9e . HEAD in this diagram is a special pointer: most of the time it points to another branch (in git terminology, this is a "symbolic link") to show the current state of health of the directory. When you say, say, git checkout f30ab , you put the repository in a detached HEAD state. In other words, you move the pointer from a symbolic link, "testing", to commit, f30ab .

Take, for example, one that you can configure yourself.

 git init /tmp/test && cd /tmp/test ;# make a repo and cd to it echo A > A ;# add a file git add A && git commit -m "first commit" ;# make the first commit echo B > B ;# add another file git add B && git commit -m "second commit" ;# commit that one too git checkout -b development ;# now let checkout development echo C > C ;# commit one more file git add C && git commit -m "third commit" ;# and commit that final one 

Now you have something like below. I don't have omnigraffle, so we are stuck with a directed graph:

  * 93e71ee - (HEAD, development) third commit / * 6378754 - (master) second commit * d2b4ba9 - first commit 

As you can conclude from parentheses, "master" points to commit 6378754 , "development" points to commit 93e71ee and HEAD points to "development". Do not take my word for it. Explore the signs yourself:

 $ cat .git/refs/heads/master ;# cat the 'master' pointer 5a744a27e01ae9cddad02531c1005df8244d188b $ cat .git/refs/heads/development ;# now cat the 'development' one 93e71ee0a538b0e8ac548e3936f696fa4936f8dc $ cat .git/HEAD ;# note that 'HEAD' points at 'development' ref: refs/heads/development $ git symbolic-ref HEAD ;# as we can also show with 'symbolic-ref' refs/heads/development 

When branches are just pointers, the transition between them is trivial. One particular case is HEAD . Think about what happens when we check the wizard:

 $ git checkout master ;# checkout master... $ cat .git/HEAD ;# where are we now? ref: refs/heads/master 

How about a commit check?

 $ git checkout d2b4ba9 ;# this will throw some advice Note: checking out 'd2b4ba9'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. $ cat .git/HEAD ;# 'HEAD' points at a commit d2b4ba97698d7f528f9ba1e08d978a70651b3b1d $ git symbolic-ref HEAD ;# and thus isn't a symbolic reference fatal: ref HEAD is not a symbolic ref 

What does this advice mean? It, which commits against the repository in the "stand-alone HEAD" state, generates errors that are inaccessible from any branch. When HEAD changes (from any validation operation, such as git checkout master ), these commits will be lost. This is easier to see on the chart:

 echo D > D ;# add another file git add D && git commit -m "fourth commit" ;# and commit it 

Let's look at our schedule. Note. The no git command generates what you see below. I modified the existing output for the purposes of this example.

  * 93e71ee - (development) third commit / * 6378754 - (master) second commit / * / 72c1f03 - (HEAD) fourth commit |/ * d2b4ba9 - first commit 

HEAD is still disconnected. He points to 72c1f03 . "master" and "development", where we expect, but 72c1f03 not available from any branch. This is problem. If I want to keep 72c1f03 around, I have to give it a branch:

 $ git checkout -b experimental ;# checkout 'experimental' based on '72c1f03' $ cat .git/HEAD ;# HEAD is once again pointed at a branch ref: refs/heads/experimental $ git symbolic-ref HEAD ;# and is a symbolic ref refs/heads/experimental 

And the schedule:

  * 93e71ee - (development) third commit / * 6378754 - (master) second commit / * / 72c1f03 - (HEAD, experimental) fourth commit |/ * d2b4ba9 - first commit 

Git simplifies branching. Tapping and pulling pointer information is much faster than tapping and pulling entire sets of files. Cutting a branch takes milliseconds. It is so easy that it almost feels wrong. As a result, git allows for more distributed workflow options , although it, of course, can also handle centralized ones.

+3
source

Switching from SVN to git is a laborious task (we have been on it for 6 months at my company), since it requires big changes in the company (training, server, communication with other tools, such as problem tracking ..., security) .

The only advantage I can find is its simplicity (since you cannot do so much except in git), workflows are easier to understand and apply, so if you are afraid that not all employees may / want to deal with the complexity of git or do not need its functions, then keep svn.

Check out this SO thread to convince yourself :).

+2
source

Source: https://habr.com/ru/post/1432471/


All Articles