The beauty of GIT and how it affects our day-to-day work

Reading Time: 3 minutes

The beauty of GIT

In this article, The beauty of GIT and how it affects our day-to-day work, I will explain why I think that GIT is a really amazing tool and why it can help develop great software.

In the last few weeks we have revised our development workflow used in our company Sigimera Ltd. During this process we have experienced that git affects not only the day-to-day work with the source code, but also the manner how we plan, implement and delivery our software. Starting from the well-known and widely used branching model described in the blog entry [1], we have decided to use the following, compacter branching model (source [2]):

branching_model

This model extends our previously used development and master branch with different feature and optional bugfixes branches. To spin this idea one step further we connect our issue management system JIRA (from Atlassian) with our current git branches. Additional we use feature branches for easy code reviews via pull request (supported by github.com, bitbucket.org and gitlab). Our productivity has raised in the last few weeks to a new high. The main reason for this is the improved communication between the developers, the clear and intuitive workflow and the automation of continuous integration and delivery. But lets start from the beginning and see how all connects.

 

GIT Branches, Issues and Quality Assurance

As mentioned we use for nearly each new feature a separate branch. This has the following advantages:

  • Easy code reviews: The reviewer can review all changes easily without digging through unrelated commits. We use for this pull requests on the bitbucket.org site. Nice feature is the side-by-side view that shows you the complete file and not only the part that differs.
  • Strict naming conventions for branches (issue names are part of the branch name): This allows the connection of (JIRA) issue with single branches.
  • (Pretty) stable development branch: We use the development branch for our staging environment. The separation of new features from this branch allows a more stable staging environment. Additional each developer can work on new features as long as he/she wants without affecting the staging environment.
  • Feature selection: We can decide shortly before the release what features are mature enough to be merged with the development branch and later with the master (production) branch.
  • Automatic quality assurance: All feature branches are merged continuously on the CI server with the development branch in order to detect conflicts and then the tests are executed to check if the new feature breaks the current and new business logic.

Let me explain the second advantage, “Strict naming conventions for branches…”, on the base of the in-house developed and open source published gitjira tool (see Sigimera/gitjira on github). After the easy installation, described on the github page, you can use the following commands to get issue information about current features (or other branch types).

$ git-jira list
Open           0% done  PROJ-123  - Implement some new feature
Resolved     100% done  PROJ-20   - And yet another feature
Resolved      42% done  PROJ-16   - Add /features page
$ git-jira describe
=> Add /features page <=

Issue Key...........: PROJ-123
Type................: New Feature
Status..............: Resolved
Progress............: 42.0 %
Estimated Work......: 1d
Remaining Work......: 4h 35m
Resolution..........: Fixed
Priority............: Major
Assignee............: Me
Reporter............: Me
Created At..........: 2013-05-26 13:09:17 +0200
Updated At..........: 2013-06-20 23:21:18 +0200
Fix Version.........: v1.2.0 (2013-06-30),

Add a page that lists all features.
$ git-jira describe -i 123 # or git-jira describe -i PROJ-123
=> Add /features page <=

Issue Key...........: PROJ-123
Type................: New Feature
Status..............: Resolved
Progress............: 42.0 %
Estimated Work......: 1d
Remaining Work......: 4h 35m
Resolution..........: Fixed
Priority............: Major
Assignee............: Me
Reporter............: Me
Created At..........: 2013-05-26 13:09:17 +0200
Updated At..........: 2013-06-20 23:21:18 +0200
Fix Version.........: v1.2.0 (2013-06-30),

Add a page that lists all features.

The jira extension for git was specific developed to support this type of workflow. It saves time during the development process by providing immediate, real-time information on the console, without opening a browser and searching for the branch related issue.

Additional to such features as one-click releases via CI, pre-development strategic meetings and the use of agile development we are able to react fast on changes without minimizing the code quality. Another advantages not mentioned above is the ability to work in parallel on different features and proof-of-concepts that are not related to the current release.

For us this workflow is the perfect combination of creative hacking and software engineering with high quality standards. Although it does not protect you completely of breaking your code base, it introduces some mechanism to improve stability and react on problems.

Please let me know in the comments what you think about this workflow and how you or your company develop software.