Commit size is a measure of the size of each commit—the sum of additions and deletions—integrated to trunk/main.
Additions and deletions represent lines of code added or deleted. For example, if a commit adds 20 new lines of code and removes 15 lines of code, the commit size is 35 lines of code.
Commit size helps you understand the size of your team’s units of work. It is an indicator of how well your team can break down code changes into smaller increments of work.
Work smaller to go faster
Small commits can improve development speed and collaboration by breaking down large changes into deployable increments of work. Small units of work are less likely to have major conflicts with other changes to your codebase and they are easier for other engineers to merge and review in detail.
When coupled with continuous integration and testing, small batches of work provide developers with faster feedback. Short feedback loops help developers discover potential improvements to their code earlier in the development process, when it is easier to fix.
Small commits are also easier to rollback and revert changes when new code creates bugs or issues.
Moreover, small units of work make changes to the codebase more visible to other engineers. Frequent, small commits prevent upcoming changes from becoming outdated and stale—hidden away in yet-to-be-merged commits. Regularly checking in code keeps engineers in-sync and aware of how the team’s codebase is changing.
On the contrary, large commits sometimes slow down your team’s ability to ship new features. They require more time to review and increase the potential for major conflicts with your codebase. If commits become unwieldy, then commit frequency—a proxy for features shipped—will typically decrease as well.
Measuring commit size
Commit size can be measured through version control tools, like git. The git diff command highlights the change in the number of additions and deletions between two commits and is used by GitHub to measure repository analytics.
On the Software.com data platform, team commit data is analyzed through Software's GitHub integration. When you connect GitHub to an organization, you will be able to see up to 90 days of historical data. GitHub metrics, such as commit size, are updated daily.