Using Git

I started using Git in my day to day, usually worked with SVN for everything due to it was the default to handle code everywhere.

I had reviewed Git a few years ago, I even presented the topic ‘Git vs Subversion’ in the Congreso Nacional de Software Libre (CONSOL), but I didn’t catch all the important features that Git has in terms of code distribution.

Clone

When I started using Git I got confused when I saw that for every single project I downloaded I needed to download all the code, basically clone the entire repository into my computer. Now that I use it for my projects, that are not that long as the LibreOffice repository, but that have quite some files due to the frameworks, I realize that if I don’t download the entire code into my machine I would require to query the server everytime I need to look at an old version of one file, something that for distributed systems or in my case corporate networks would require bandwidth and time. With Git I better download once than every day time waisting with SVN.

Commit vs Push

Commit is not the same as Push I know but when you arrive from SVN to Git, you find out that you have some additional steps than just commit your code. Locally and for personal and small projects you wont require it but you would for distributed repositories. As you may already know git clones all the repository into your computer when you download the code using ‘git clone’ making it a local repository, but if you have multiple local repositories, you need a way to share your code with all the team, there you use the ‘git push’. This command allows you to copy your code into the main repository, the one that all your team has agreed to set as main, it does not even require to be a server it could be a folder in a computer that you can access through SSH. Once you push your code all the team can use ‘git pull’ to download the code and start using it, and due to Git is really well designed, git would know how which is the compararition points to merge your local repository with the code downloaded from the main repository.

Anyway, Git is a really functional tool, that will improve the way developers work together, but it has a dark side, the learning curve is longer than with SVN due to the amount of commands and steps each process would require.

Unfortunately the open source GUI tools for git are not as simple as for example tortoiseSVN or rapidSVN but as with many other tools in the linux environment the command line is the best way to use it.