---
title: "Git Organized: A Better Git Flow"
description: "Commit-as-you-go branches often produce commits mixing unrelated or half-finished changes, which makes reverts risky and pull requests tedious to review."
url: "https://swe.quest/articles/git-organized-a-better-git-flow-7c1f2e19e2ec05be"
canonical: "https://render.com/blog/git-organized-a-better-git-flow"
source: "Render"
published: "2022-01-14"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["version-control","code-review"]
---

# Git Organized: A Better Git Flow

A post on [Render](https://swe.quest/sources/render.md), published 2022-01-14, 5 min read, How-to. Original: [https://render.com/blog/git-organized-a-better-git-flow](https://render.com/blog/git-organized-a-better-git-flow)

## Summary

Commit-as-you-go branches often produce commits mixing unrelated or half-finished changes, which makes reverts risky and pull requests tedious to review. A cleaner flow is to do the work first with throwaway WIP commits, then \`git reset\` back to the branch point (keeping the working tree), and rebuild logically grouped commits using \`git add -p\` for partial files. Verify that each new commit works on its own by stashing the remaining changes and testing, and use \`git commit --amend\` to fix up omissions. If anything goes wrong, \`git reflog\` can recover the original commits.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Version control](https://swe.quest/tags/version-control.md) (Engineering practices)
- [Code review](https://swe.quest/tags/code-review.md) (Engineering practices)

## Prerequisites

- basic git commands
- pull request workflow

## Keywords

git, git reset, git reflog, git add --patch, git stash

## Related posts

- [On the Importance of Pull Request Discipline](https://swe.quest/articles/on-the-importance-of-pull-request-discipline-bc0f7e3942802cb3.md): Shopify Engineering · 2022-10-13 · Medium · 13 min read · Code review, Version control, Developer productivity
  Well-structured pull requests make code review easier and leave a self-documenting history that speeds debugging and rollbacks.
- [Merging two GitHub repositories without losing commit history](https://swe.quest/articles/merging-two-github-repositories-without-losing-commit-history-7428e9ac84244059.md): Mozilla Hacks · 2022-08-29 · Medium · 15 min read · Version control, Developer tools
  MDN merged small example repositories into a larger parent repo while keeping full commit history, using only plain git commands.
- [WebKit on GitHub!](https://swe.quest/articles/webkit-on-github-d3587a8b64d71587.md): WebKit · 2022-08-31 · Easy · 2 min read · Version control, Open source, Browsers
  WebKit froze its Subversion tree on June 23rd and moved source control to git hosted on GitHub, citing git's distributed collaboration model, its author/committer model, cheap branch and revert operations, and the fact that most contributors already worked from git-svn mirrors.
- [How the GitHub CLI can now enable triangular workflows](https://swe.quest/articles/how-the-github-cli-can-now-enable-triangular-workflows-9d168cb0f33f735d.md): GitHub Engineering · 2025-04-25 · Medium · 10 min read · Version control, Developer tools
  GitHub CLI v2.71.2 makes \`gh pr\` commands resolve a branch's push and pull targets the same way Git does, so triangular workflows work.
- [Code Review Can Be Better](https://swe.quest/articles/code-review-can-be-better-2739fb600c90a5b6.md): TigerBeetle · 2025-08-04 · Medium · 4 min read · Code review, Version control, Developer tools
  TigerBeetle shelved git-review, an experiment that stored code review as a single commit of inline marked comments on top of the PR branch, edited by author and reviewer and reverted once all threads were resolved.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
