Showing posts with label source control. Show all posts
Showing posts with label source control. Show all posts

Wednesday, January 8, 2020

Git vs Subversion

A version control system makes it possible to keep track of changes and go back and look at the history of changes.

It can be used for keeping track of your source code if you are a software developer.

Ten years ago Subversion was probably the most popular.

Today Git is probably the most popular, in part due to github where you can share your stuff with other people.

Here are the main differences:

Subversion:

  • Is a centralized version control system, where the repository is located on a server, and you pull down a working copy to your machine
  • All operations, like commit, branch, merge, happens on the server and require network operations
  • You have to pull the latest changes from the server before you can commit
  • The history on a given branch is linear
Git:
  • Is a distributed version control system, where the entire repository is both on the server as well as on the computers of all the users that are working on that repository
  • Many operations run locally on the computer of the user, for example commit, branch, and merge
  • You can commit locally a lot, even though other users on other computers have made commits on the same branch and pushed those commits to the server
  • The history on a given branch can become, well, branched, when multiple users are working on the same branch, or when merging changes from other branches
These differences mean that there are some benefits in using Git over Subversion:
  • Branching and merging and working on the same branch as other people is usually painless in Git, whereas simple branch and merge scenarios on Subversion could give a lot of trouble (well, even git is not idiot-proof: if you have been working on a branch for a long time without integrating your changes with other people, and if other people have made significant changes to the same files, then you might be in for a big surprise, and potentially a lot of rework, when you merge)
  • Git is just faster than Subversion (since many operations are local in Git)
  • You have the entire history locally, which can give you faster access
  • With Git you have several copies of the entire repository, making you less vulnerable to the server crashing
Here's a little example of how the history can look on a branch in git, after merging in changes from the master branch:

Saturday, January 10, 2009

Learning and Living

"To live is to learn."

"To read is to live."

Or maybe it is "Living is living" and "I am".

The last three months have meant some changes to how I work:

I now use source control for code related work: Subversion with TortoiseSVN in Windows Explorer and ankhsvn in Visual Studio. This has given me a feeling of greater security that my work is properly backed up, more speed in development since I don't have to manage (copy) revisions manually. Any new experiment I do can only destroy the changes I've made since the last time I committed changes to source control. Therefore I commit changes every time a piece of a task is completed. In addition to the code change itself, to each commit I add a short description of what has changed. This means that I get an overview of what has changed on a given project by reading the repository log.

Joel Spolsky says, among other things, that Daily Builds Are Your Friend. By setting up a build server I now have a system that, for most of the projects, will compile the code and test it. By using CruiseControl.NET I automatically get feedback when commited code breaks a build.

An extra benefit from the above is that I have learned how to write build scripts using NAnt. So now, after making some small code change, I can run a bat file and the solution will be compiled and the installers packaged for the consultants or for grabbing via ftp from a remote server.

This week I set up BugTracker.NET which seems to fulfil our requirements about a system that we can use internally for tracking bugs, issues, and requests from customers. I appreciate the work of Corey Trager and other people who release their private work for public use.

So now I'm about half-way through The Joel Test, and I don't know where this will end...