PHP Classes

The Benefits of Using Git in Your Software Projects Part 2: Collaboration, Web Platforms and Migration

Recommend this page to a friend!
  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog The Benefits of Using...   Post a comment Post a comment   See comments See comments (3)   Trackbacks (0)  

Author:

Viewers: 147

Last month viewers: 2

Categories: PHP Tutorials

Nowadays working with a version control application like Git is mandatory for all software developers, even those that work alone in private projects that are not going to be published anywhere.

In the first part of this article we covered the basic benefits of working it explaining some of the most commonly used features, some very well known, others not so much.

Read this part the article to learn how use Git in projects the involve collaboration between multiple developers, how to take advantage of existing Web platforms that support Git, and how to migrate from older version control applications like SubVersion.




Loaded Article

Contents

Introduction

Collaboration Between Developers

What is Git Flow?

Who to Blame for bugs?

Web platforms using Git

GitHub

Bitbucket

Migrating from SubVersion to Git

Conclusion


Introduction

This part of the article assumes that you are familiar with the concepts of Git introduced in the article first part.

This time it is covered the application of those concepts to improve the quality of your software development environment.

Collaboration Between Developers

Previously branches were described as a means to work on new experimental features without interfering with the main code of your project.

Lets see how branches and other features of Git can be used in practice to promote better collaboration between developers working on the same project.

What is Git Flow?

Git Flow is a model for creating branches with Git, created by Vincent Driessen. It became popular among the community of developers that work with Git because it is very convenient for collaboration within development teams and works well when the teams grow.

When a developer starts working on a new feature or bug fix, he creates a new branch. When he is done with the new feature or the fix, he merges the new branch back to the main branch.

Feature branches

GitFlow supports feature branches and hot fixes. The feature branch will be merged back to the develop branch (some kind of staging area) ready to be release. The hot fixes are done on tagged release that will only contain emergency fixes, so they are treated in isolation.

Git Flow makes parallel development easy by isolating new development from finished work.

For developers, changing between the branches they are working on, or starting new feature branches in the middle of something is fast and easy to do with Git. Git keeps track of the modifications without creating a new repository from scratch.

It is easy to see and follow what each collaborator is doing, inspecting the commits and jumping on branches.

You may learn more about Git Flow on Vincent Driessen blog. He also provides tools to make it easier to implement Git Flows in your projects.

Who to Blame for bugs?

If you have found a bug in your code and you want to know when was introduced and why, you can use git blame command. This is a command that shows when each line of a given file was last edited and by whom.

Web platforms using Git

Git has been supported by many project hosting sites. Here follow some considerations on the two most popular Web based project hosting service based on Git.

GitHub

Github is the largest project host on the planet with over 25.2 million repositories. Some of the main features are the integrated issue tracking, the collaborative code reviews, and easy team management.

Bitbucket

Bitbucket is sometimes the company choice because of the strong team management tool it provides.

Bitbucket manages the GitFlow in an easy way, and it is totally integrated with Jira, their issue tracking application.

Bitbucket also provides additional features like:

  • Online tools for comparing branches

  • Management of pull requests, with comment and easy inspection about changes (useful often in a review process)

  • It is easy inspection of commits and see the flow of the structure

  • Allow comments

  • Create and track issues

  • Integrations and support for other 3rd party tools like IDE, Web platform, services, and others

Migrating from SubVersion to Git

If you have been using SubVersion version control application and you would like to switch to Git, migrating from a SubVersion repository to Git is quite easy using several tools that are available on the Web like svn2git and subgit.

Every tool mainly follows two steps to perform the conversion:

1. Checkout the svn repository

2. Conversion to Git including the commit history

Some tools provide the possibility to synchronize back to SubVersion after having done modifications to the project using Git.

Conclusion

In this part of the article we learned about important practices using Git that make collaboration between multiple developers work better in your project, important features of the two main project Web hosting platforms that support Git, and how to migrate to Git from SubVersion.

If you liked this article or have a question, post a comment here.




You need to be a registered user or login to post a comment

1,616,107 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on:



Comments:

1. i following - tinashe zulu (2015-09-02 00:47)
getting better... - 2 replies
Read the whole comment and replies



  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog The Benefits of Using...   Post a comment Post a comment   See comments See comments (3)   Trackbacks (0)