Sunday, July 3, 2016

Git Tutorial 1-- differences between SVN and Git



My team is transitioning from SVN to Git, and the journey proves to be very difficult. A lot of them feel either confused or time-wasting to use Git. This got me thinking: I have read a lot of Git tutorials, but most of them are focused on how each Git command is for, and what Git workflow you should use. There are seldom tutorials who are written from an average software engineer’s point of view: an average software engineer is someone who works on code, and compares his code with the code in the repository (the central reposity) to make sure that the code he has been working on hasn’t been changed by others, and when he feels ready, he pushes his changes to the repository so others can use his code. What are the ways an average software engineer should conduct his daily work? And what are the pros and cons for each way? 

This series of tutorials try to answer these questions. 

The first tutorial is, of course, about the differences between SVN and Git. 

Coming from SVN, the biggest difference one needs to be aware is that with Git has a “local” repository, and commit is to commit to the local repository. 

Compared with SVN, a software engineer needs to go through more steps to get one’s code into the central repository. This alone is confusing for newbies. To make things worse, in Git, you have to juggle among branches, and you have many ways to do the same thing, which adds more confusion (more on this in later tutorials).

Some commands have the same format in SVN and Git, look out for them:

  • git commit is to commit to local repository, git push pushes a branch in the local repository to the remote repository.
  • git checkout is to checkout a branch from the local repository.

No comments:

Post a Comment