DEV Community

Aniket
Aniket

Posted on

Git rebase conflicts are painful. Let `grebase` fix them for you. πŸ˜‰

GitHub β€œFinish-Up-A-Thon” Challenge Submission

This is a submission for the GitHub Finish-Up-A-Thon Challenge

What I Built

I built grebase β€” a terminal CLI that makes git rebase something you stop dreading.

Every developer who contributes to open source knows the moment: a reviewer comments "could you rebase main?" and you quietly panic. Conflict markers, unrelated commits, force push at the wrong time, it's a mess every time.

So I built grebase to handle the painful parts automatically.
I've built a tool that will make our rebase process smooth . I named it grebase.

Here is what it does:

  • Fetches latest from upstream and detects your target branch
  • Starts the rebase and monitors every conflict as it happens
  • Auto-resolves mechanical conflicts β€” import ordering, lockfile churn, whitespace differences, duplicate blocks, documentation changes
  • Asks you for semantic conflicts β€” shows both sides clearly and lets you decide: keep mine, take theirs, keep both, or edit inline
  • Inline terminal editor β€” when a conflict needs manual work, you edit right there in the terminal without opening any file or IDE
  • Audit log so you know exactly what grebase decided and why
  • --dry-run to preview everything before it touches your branch
  • --safe-only to auto-resolve only what is mathematically safe

When it is done, your branch is cleanly rebased and ready to push.

pipx install grebase
grebase main
Enter fullscreen mode Exit fullscreen mode

Demo

(typeshed) aniket@DESKTOP-074O80J:/mnt/d/typeshed/typeshed$ grebase
βœ“ Repository detected
βœ“ Current branch: fix-15012
βœ“ Target branch: origin/main
βœ“ Remote: origin
i Incoming changes summary:
stubs/colorful/colorful/__init__.pyi | 59 ++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
βœ“ Fetch completed
βœ“ Rebase successful
(typeshed) aniket@DESKTOP-074O80J:/mnt/d/typeshed/typeshed$

The Comeback Story

  • This project started just before sometime when i got stuck to one of my PRs to the NVIDIA NeMo/RL repository because I needed to rebase main, and like many times before, I ended up making a mess of it.

  • from there I decided why not lets make a tool to make this rebase process smooth for everyone, specially beginners like me who face difficulty.

My Experience with GitHub Copilot

  • It really helped me to build my project, i took help in reviewing , even implementing new feature and fixing existing bugs.

overall great for moving fast on the parts you understand well, less useful as a substitute for thinking on the parts that are genuinely hard.

Thank you for reading my post, i'd be happy to receive feedback on grebase.

Top comments (0)