In Praise of Stacked PRs

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • git-branchless

    High-velocity, monorepo-scale workflow for Git

    The linked tool git-branchless handles this pretty well (https://github.com/arxanas/git-branchless, I'm the author). You basically run `git checkout `, `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.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • git-stack

    Stacked branch management for Git

    > Probably some arcane git magic to (interactively) rebase branch

    There is not really a command for that yet, short of adding a bunch of `exec` steps to your interactive rebase manually. See https://news.ycombinator.com/item?id=32217204 for an upcoming command.

    You might enjoy using https://github.com/gitext-rs/git-stack, which specifically tries to let you manage stacked branches locally while not exposing tons of PRs to your coworkers.

    git-branchless itself also lets you manage stacked branches in various ways. For example, you can do `git checkout `, `git commit --amend`, and then `git restack` to rebase all the descendant branches sensibly. You can use it on the local side of things only and then use Github PRs as normal.

  • git-prev-next

    Simple way to edit in a git commit history

    Plugging my own tool: if you like to cultivate a stack of commits, you'll know how awkward git makes it to edit previous commits. I wanted to just write `git prev 3` and then `git commit --amend` so I wrote `git-prev-next`: https://github.com/ridiculousfish/git-prev-next

  • autorebase

    Automatically rebase all your branches onto master

    That sounds great! I have partly solved this issue in my autorebase tool (https://github.com/Timmmm/autorebase) - it basically rebases every branch, and fixes the commit time so that stacked branches get preserved even after a rebase just because the hashes all match properly.

    That obviously doesn't work if you modify or drop any of the commits, so this option is very welcome!

  • Also a big fan of https://gitlab.com/wavexx/git-assembler (and previously topgit). Works with the basic idea that you can rebuild branches by combining, merging or rebasing automatically on top of others. I frequently use this to build a local branch which is an amalgamation of the main branch + required patches so that I can work (and later submit) on a clean branch without being blocked.

  • Git Town

    Git branches made easy

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Working with stacked branches in Git is easier with –update-refs

    1 project | news.ycombinator.com | 15 Jul 2024
  • Neofetch for Git Repositories

    1 project | news.ycombinator.com | 24 Mar 2024
  • Programming languages' logos in ASCII art

    1 project | news.ycombinator.com | 23 Mar 2024
  • Onefetch: Command-line Git information tool written in Rust

    1 project | news.ycombinator.com | 12 Jan 2024
  • 5 Developer CLI Essentials

    3 projects | dev.to | 2 Jan 2024

Did you konow that Rust is
the 5th most popular programming language
based on number of metions?