⬆️ ⬇️

how to: How and why to work with svn via git

Good day!



In the article I will tell you how we work with svn through git and why we didn’t choose pure git.



Svn



Subversion is a centralized version control system. This is its main minus and its main plus :)

')

The advantage is that centralization makes it possible, for example, to number commits, since their order is known.

It also minimizes conflicts (although this can be argued about), because The current state of the repository is one and it is known to all.

In svn you can store multiple projects in one repository. In general, the svn repository intefrace is very similar to the file system, which provides a minimum entry threshold for those who have never worked with version control systems.



The main disadvantage is merge ... Those who often do merge with svn means understand what I mean.

This is slow (even meeeeeeeleeneno), requires a constant connection to the repository, and these svn-properties, which make it difficult to read the diff.





It would seem - the solution lies on the surface, you just need to change the version control system. In our case, you can’t just go and go to git.



There are several reasons for this, and all of them are due to heritage. If we started development now, then most likely we would choose git. We have a repository for about six years, during which time we have created 129 projects in it, and the number of audits exceeded 88,000.

We use trac as a bugtracker. It is now more than 10 thousand tickets. Many have links to commits confirming corrections. This rich heritage does not want to lose.

Also, svn has a plus - all projects are in the same repository. Trac thinks that we have one project, which greatly facilitates working with him.

In other words, giving up svn is too expensive for us, but merzh ...



Decision



Let svn be inside the repository, but everyone will work with it through git. Let's do it!



Actually everything.



The trunk is now called master, all other branches are named as usual.

Work with brunches:

  git branch -r #   git checkout -b dovgBranch dovgBranch #     dovgBranch    dovgBranch git branch # β€”       


For example:

 dovg@marvin ~/job/oemdesign/www/plus1.wapstart.loc/plus1 $ git branch dovgUnique experimental * master moderation production referals targetingCountry uniqueCookie uniqueSession --------- 


And how to work with it now?





Finally a small FAQ:





Instead of conclusion



For a long time, this article has hung in the Wapstart internal wiki. It seemed to me that it could be useful to the community. The result is in front of you. ;)

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



All Articles