VOOZH about

URL: https://thenewstack.io/another-way-to-git-bundle-commits-into-logical-groups/

⇱ Another Way to Git: Bundle Commits into Logical Groups - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2022-03-16 09:36:36
Another Way to Git: Bundle Commits into Logical Groups
news,
Software Development

Another Way to Git: Bundle Commits into Logical Groups

The approach eschews the common tendency to commit often, documenting a work in progress, and instead bundles commits of the same feature branch into logical categories, only after work on the feature is largely finished.
Mar 16th, 2022 9:36am by Joab Jackson
👁 Featued image for: Another Way to Git: Bundle Commits into Logical Groups
Feature image by Lucas George Wendt on Unsplash

Another way to use the git distributed version control system has been under discussion lately. Proposed in January by Annie Sexton, a UX engineer at the DevOps Cloud Platform Render, this approach could make lives easier for both the developer and the reviewer of pull requests, she argues.

Instead of committing often, documenting a work in painstaking progress, this approach bundles commits of the same feature branch into logical categories, only after work on the feature is largely finished, she explained in a blog post describing this new technique.

“The end result is a very, very tidy and well-organized git history,” Sexton elaborated in a recent edition of the ChangeLog podcast.

The show’s co-host, Jerod Santo, also saw potential value in the approach.

Santo explained that it differed from the canonical method — as often espoused by Richard Hipp, who’s the author of Fossil distributed version control system — in which “every commit that you commit is immediately shared over the network with everybody else. There’s no hiding anything.”

In contrast, Sexton’s approach is more like getting cleaned up before you go to a restaurant, Santo observed.

Relief for the Reviewers

When building a new feature, most development teams will first create a new branch off of the main codebase, and create commits when each chunk of work is completed. When the feature is complete, they issue a pull request (PR), which is reviewed and entered into the main branch when accepted.

Great. But there are some limitations to this approach, Sexton points out. One is that, almost invariably, certain commits contained unfinished work. Another problem with this approach is that it creates a lot of work for the team that reviews the PR. Rare is the commit that only has one change. Often many are captured in the committed, and they can be across the codebase in a way that is difficult for the reviewer to track.

The approach Sexton advocates is different. She separates the engineering work from the commit documentation. Work on the feature as usual, but don’t worry about commenting on the commits as that info will be erased later anyway. Just mark them as a “work-in-progress” (or “WIP”). The developer is free to leave work unfinished, knowing that they can get back to it later.

When the developer has finished all your changes, they do a git reset, a command that, without flags, erases the commit history.

Typically developers are discouraged from using this command, as it erases the commit history of the work. They should not be so worried, she advises.

“I think I was coached back in the day that things are irreversible if you use git reset, and it’s super-dangerous. And it’s not. It’s really not. There’s actually very few things in git that you can’t undo,” she said on the podcast. The changes still can be revealed through git reflog.

“The following approach was inspired by my coworker, Dan Wendorf, whose git flow tends to revolve around one core principle: do the work first, clean up the commits later.” https://t.co/xmex1y7PXH @_anniebabannie_ @render #Git #Workflow

— Joab Jackson (@Joab_Jackson) March 8, 2022

The final step, Sexton advises, is to go back over the code and do a new set of commits, categorically, looking for logical groupings that would go well together. The idea is to make the pull request “much easier to review by splitting up our changes into human-readable, easy-to-follow commits,” Sexton wrote.

“When I’m in development mode, I’m in development mode, and I’m just problem-solving, and I don’t have to switch mentally to thinking about git as well.”

After the reset, “it looks like you’ve just made all of your changes all in one go, without ever making a single commit. And then, you can go through and pick out which files seem to go together the best, and just group your changes into logical commits,” she said.  “So it’s as if I knew exactly what I was gonna build, every single line, and I committed them one after the other, as if I was like a robot.”

A good tool, such as VS Code, can help in this grouping of commits, she noted.

For the developer, one advantage here is that it breaks committing and development into two separate tasks entirely. “What I love about this is that they’re completely separate tasks,” she further explained in the podcast.  “When I’m in development mode, I’m in development mode, and I’m just problem-solving, and I don’t have to switch mentally to thinking about git as well, because all of that gets taken care of later.”

Different Strokes

While most developers use git in one particular way, there is nothing stopping us from using it in other ways. Git itself is in fact very unopinionated about how it is used, Santo noted.

” I do think that Git is old enough that many, many people, many veterans of git have tested it a lot of different ways, tried it different ways, and have some really valuable workflows that people can rely on. But it’s still flexible enough that people can do it other ways if they want to,” Sexton agreed.

Still, many developers remain skeptical. We asked one of our git gurus, Michelle Gienow, who has penned a number of git tutorials for TNS. “It does not appeal to me personally as a way to work, I don’t think, but then I shouldn’t knock it until I try it. I can certainly see the appeal in the logic,” she responded, via a Twitter message.

The Changelog 480: Git your reset on – Listen on Changelog.com

TRENDING STORIES
Joab Jackson is a senior editor for The New Stack, covering cloud native computing and system operations. He has reported on IT infrastructure and development for over 30 years, including stints at IDG and Government Computer News. Before that, he...
Read more from Joab Jackson
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.