HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
arxanas
git-branchless
Rust2021–2025
arxanas / git-branchless

git-branchless

High-velocity, monorepo-scale workflow for Git

26Distinct people
65Mentions
0Explicit recommenders
4.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

High-velocity, monorepo-scale workflow for Git

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

  • jj-vcs/jj · linked in 6 of the same discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 9:02:44 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year65 dated mentions

Observed mentions: 2021-03-29 17:08:51 UTC to 2025-12-20 07:55:29 UTC.

05101520252021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 23 mentions; 2 submissions, 21 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 20 mentions; 2 submissions, 18 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC23221
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC20218
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC918
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC606
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC716

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Branchless workflow for Git (This suite of tools is 100% compatible with branches. For more discussion, see this thread.) ▼ Jump to installation ▼ ▼ Jump to table of contents ▼ About git-branchless is a suite of tools which enhances Git in several ways: It makes Git easier to use, both for novices and for power users. Examples: git undo: a general-purpose undo command. See the blog post git undo: We can do better. The smartlog: a convenient visualization tool. git restack: to repair broken commit graphs. Speculative merges: to avoid being caught off-guard by merge conflicts. It adds more flexibility for power users. Examples: Patch-stack workflows: strong support for "patch-stack" workflows as used by the Linux and Git projects, as well as at many large tech companies. (This is how Git was "meant" to be used.) Prototyping and experimenting workflows: strong support for prototyping and experimental work via "divergent" development. git sync: to rebase all local commit stacks and branches without having to check them out first. git move: The ability to move subtrees rather than "sticks" while cleaning up old branches, not touching the working copy, etc. Anonymous branching: reduces the overhead of branching for experimental work. In-memory operations: to modify the commit graph without having to check out the commits in question. git next/prev: to quickly jump between commits and branches in a commit stack. git sw -i/--interactive: to interactively select a commit to switch to. It provides faster operations for large repositories and monorepos, particularly at large tech companies. Examples: See the blog post Lightning-fast rebases with git-move. Performance tested: benchmarked on torvalds/linux (1M+ commits) and mozilla/gecko-dev (700k+ commits). Operates in-memory: avoids touching the working copy by default (which can slow down git status or invalidate build artifacts). Sparse indexes: uses a custom implementation of sparse indexes for fast commit and merge operations. Segmented changelog DAG: for efficient queries on the commit graph, such as merge-base calculation in O(log n) instead of O(n). Ahead-of-time compiled: written in an ahead-of-time compiled language with good runtime performance (Rust). Multithreading: distributes work across multiple CPU cores where appropriate. To my knowledge, git-branchless provides the fastest implementation of rebase among Git tools and UIs, for the above reasons. See also the User guide and Design goals. Table of contents About Demos Repair Visualize Manipulate Installation Status Related tools Contributing Demos Repair Undo almost anything: Commits. Amended commits. Merges and rebases (e.g. if you resolved a conflict wrongly). Checkouts. Branch creations, updates, and deletions. Why not git reflog? git reflog is a tool to view the previous position of a single reference (like HEAD), which can be used to undo operations. But since it only tracks the position of a single reference, complicated operations like rebases can be tedious to reverse-engineer. git undo operates at a higher level of abstraction: the entire state of your repository. git reflog also fundamentally can't be used to undo some rare operations, such as certain branch creations, updates, and deletions. See the architecture document for more details. What doesn't git undo handle? git undo relies on features in recent versions of Git to work properly. See the compatibility chart. Currently, git undo can't undo the following. You can find the design document to handle some of these cases in issue #10. "Uncommitting" a commit by undoing the commit and restoring its changes to the working copy. In stock Git, this can be accomplished with git reset HEAD^. This scenario would be better implemented with a custom git uncommit command instead. See issue #3. Undoing the staging or unstaging of files. This is tracked by issue #10 above. Undoing back into the middle of a conflict, such that git status shows a message like path/to/file (both modified), so that you can resolve that specific conflict differently. This is tracked by issue #10 above. Fundamentally, git undo is not intended to handle changes to untracked files. Comparison to other Git undo tools gitjk: Requires a shell alias. Only undoes most recent command. Only handles some Git operations (e.g. doesn't handle rebases). git-extras/git-undo: Only undoes commits at current HEAD. git-annex undo: Only undoes the most recent change to a given file or directory. thefuck: Only undoes historical shell commands. Only handles some Git operations (e.g. doesn't handle rebases). Visualize Visualize your commit history with the smartlog (git sl): Why not git log --graph? git log --graph only shows commits which have branches attached with them. If you prefer to work without branches, then git log --graph won't work for you. To support users who rewrite their commit graph extensively, git sl also points out commits which have been abandoned and need to be repaired (descendants of commits marked with rewritten as abcd1234). They can be automatically fixed up with git restack, or manually handled. Manipulate Edit your commit graph without fear: Why not git rebase --interactive? Interactive rebasing with git rebase --interactive is fully supported, but it has a couple of shortcomings: git rebase --interactive can only repair linear series of commits, not trees. If you modify a commit with multiple children, then you have to be sure to rebase all of the other children commits appropriately. You have to commit to a plan of action before starting the rebase. For some use-cases, it can be easier to operate on individual commits at a time, rather than an entire series of commits all at once. When you use git rebase --interactive with git-branchless, you will be prompted to repair your commit graph if you abandon any commits. Inst
Read the full README on GitHub

What Hacker News says

20 sources
Yes, in my preferred workflow, I usually create a temporary commit and then switch away. Sapling also has `sl shelve` as `git stash`. If you want to run tests on commits without checking them out, you might want to try my `git test` command: https://github.com/arxanas/git-branchless/discussions/643 You can use `sl fold --exact` to combine arbitrary commits without including the current one. (To be honest, I just always used `sl histedit`.)
In Sapling: A new source control system with Git-compatible client
To use a similar featureset but in the same Git repository you normally use, you can try my https://github.com/arxanas/git-branchless. Then, you can use your usual staging workflows if desired, or use regular Git commands directly. Its design is inspired by Sapling, and, in fact, it uses some of the same code, such as the segmented changelog implementation. Possibly some of its ideas made their way back to Meta, such as interactive undo? Jujutsu also supports colocated Git repositories: https://github.com/martinvonz/jj. It also has the working-copy-as-a-commit idea and conflicts are stored in commits (so rebases always succeed). I think it's a step forward compared to git/hg/sl.
In Sapling: A new source control system with Git-compatible client
What happens is you work somewhere that has stacked diffs and suddenly you learn how to shape your diffs to make them easy to review. Thinking of how folks will review your code in chunks while writing it makes it cleaner. Having small but easy to read diffs makes reviews faster and helps junior devs learn how to review. Sometimes this doesn’t happen in which case you end up need to split your commit at the end. This is where git utterly fails. You end up needing git split and git absorb to make this productive. Git split let’s you select which chunks in a commit should belong to it and then splits that into a commit and then you do it again and again until you have lots of commits. You’ll still need to probably test each one but the majority of the work is done Git absorb takes changes on the top of your stack and magically finds which c
Read the rest
ommit in your stack the each chunk should belong to and amends it to the right commit You also need git branchless https://github.com/arxanas/git-branchless as it lets you move up and down the stack without needing to remember so much git arcana.
In Show HN: Maiao, Stacked Diffs for GitHub
sort of, but without the commit lineage requirements? I haven't used Gerrit. It's currently a few lines, looks for the branches and commits based on some strings, and prepares a bash script to run the gh cli to open PRs that are chained/stacked together. Was looking at these for reference. - https://jg.gg/2018/09/29/stacked-diffs-versus-pull-requests/ - https://github.com/arxanas/git-branchless - https://cli.github.com/manual/gh_pr - https://github.com/arxanas/git-branchless/discussions/45 - https://github.com/stacked-git/stgit/ - https://stackoverflow.com/questions/26619478/are-dependent-p... - https://gist.github.com/Jlevyd15/66743bab4982838932dda4f13f2... And was hoping for something simple-ish.
In Bash script uses gh CLI to open patch stack
git-branchless author here. By "branchless", I mean literally using detached HEAD as the primary state of development. If you're using tools like Gerrit or Phabricator, you never have to explicitly make a branch to get your code merged. If using GitHub, then branches are unavoidable, but it can be nice to do branchless development as part of rapid prototyping (see https://github.com/arxanas/git-branchless/wiki/Workflow:-div...). Another term you could use is "anonymous branching". This is not technically accurate in the above workflows, but it captures the essence pretty well in Git, more so than "branchless".
In In Praise of Stacked PRs
The linked tool git-branchless handles this pretty well (https://github.com/arxanas/git-branchless, I'm the author). You basically run `git checkout <branch>`, `git commit --amend`, and then `git restack`. This will rebase all dependent branches. As long as you're not using merge commits, you won't have to resolve the same conflict more than once. (It will also warn you up front whether or not merge conflicts will need to be resolved; you can pass `--merge` to start merge conflict resolution.) To rebase your commit stack on top of the main branch, use `git sync` instead of `git merge`. Merge commits often make it so that you have to resolve conflicts multiple times.
In In Praise of Stacked PRs
This is one of the big features from git-branchless (https://github.com/arxanas/git-branchless/wiki/Command:-git-...) which is recommended in the article; moving a stack (sub-tree) of commits instead of just one branch. Might be useful for you if you find the rebase flow to be painful. In particular this can be good for local prototyping where you have a bunch of functional candidates on top of some foundational refactors, and you may be rebasing frequently to refine those foundational commits.
In In Praise of Stacked PRs
My project https://github.com/arxanas/git-branchless does this. Use `git undo -i` to get a graphical view of where branches were at an arbitrary previous point in time. It's worth noting that, in principle, there are cases where the reflog will have never observed a branch move. The reflog we usually look at is that of HEAD; if HEAD did not have the branch checked out when it moved, then that information will be lost. (For example, if you run `git branch -f my-branch abc123`, the branch will be forcibly reassigned without having been checked out.) See https://github.com/arxanas/git-branchless/wiki/Architecture#... for more details.
In Things I wish everyone knew about Git (Part II)

Showing the 15 most recent of 20 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.