<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/reworking-git-branches-with-git-filter-branch-gkez485pn" -->

---
title: Reworking Git Branches with git filter-branch | daily.dev
description: A walkthrough of using `git filter-branch` to solve a complex documentation backport problem in the Debezium project. The situation involved divergent branch...
canonical: https://daily.dev/posts/reworking-git-branches-with-git-filter-branch-gkez485pn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Reworking Git Branches with git filter-branch | daily.dev
og:description: A walkthrough of using `git filter-branch` to solve a complex documentation backport problem in the Debezium project. The situation involved divergent branch...
og:url: https://daily.dev/posts/reworking-git-branches-with-git-filter-branch-gkez485pn
og:image: https://api.daily.dev/og/posts/gKez485pN.png
og:image:alt: Reworking Git Branches with git filter-branch
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Reworking Git Branches with git filter-branch

**[Gunnar Morling](https://daily.dev/sources/gunnar-morling)** · 5 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of using `git filter-branch` to solve a complex documentation backport problem in the Debezium project. The situation involved divergent branch structures (monolithic vs. modularized AsciiDoc files) with hundreds of commits making cherry-picking impractical. The solution used `--subdirectory-filter` to isolate documentation-only commits from master, `--tree-filter` to restore the original directory layout, interactive rebase to clean up the first commit, and `git rebase --onto` to transplant the filtered commits onto the target branch. A final interactive rebase discarded commits irrelevant to the 1.0 release.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.morling.dev/blog/reworking-git-branches-with-git-filter-branch/>

## Similar posts on daily.dev

- [Stacked Diffs with \`git rebase --onto\`](https://daily.dev/posts/stacked-diffs-with-git-rebase---onto--cuvfc5g6f) · Hacker News · 0 upvotes · 0 comments
- [Merging GitHub Repositories](https://daily.dev/posts/merging-github-repositories-a4bvbgvww) · Kitty says hi. · 1 upvotes · 0 comments
- [A Better Way to Prune Git Branches: fzf and a Tiny Loop](https://daily.dev/posts/a-better-way-to-prune-git-branches-fzf-and-a-tiny-loop-wruwytdqv) · Atomic Spin · 2 upvotes · 0 comments
- [Git Rebase for the Terrified](https://daily.dev/posts/git-rebase-for-the-terrified-ynroja8em) · Hacker News · 1 upvotes · 0 comments
- [Medium](https://daily.dev/posts/medium-l8tq260qn) · Medium · 0 upvotes · 0 comments

---

Tags: [#git](https://daily.dev/tags/git), [#version-control](https://daily.dev/tags/version-control)

[View this post on daily.dev](https://daily.dev/posts/reworking-git-branches-with-git-filter-branch-gkez485pn)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Reworking Git Branches with git filter-branch","url":"https://daily.dev/posts/reworking-git-branches-with-git-filter-branch-gkez485pn","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/reworking-git-branches-with-git-filter-branch-gkez485pn"},"datePublished":"2026-03-16T08:14:20.901Z","dateModified":"2026-03-16T08:26:36.410Z","description":"A walkthrough of using `git filter-branch` to solve a complex documentation backport problem in the Debezium project. The situation involved divergent branch...","image":"https://media.daily.dev/image/upload/s--qPvKM23u--/f_auto/v1722860399/public/Placeholder%2009","thumbnailUrl":"https://media.daily.dev/image/upload/s--qPvKM23u--/f_auto/v1722860399/public/Placeholder%2009","isAccessibleForFree":true,"articleSection":"Gunnar Morling","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Gunnar Morling","logo":"https://media.daily.dev/image/upload/s--77UJH_xq--/f_auto,q_auto/v1773648773/logos/gunnar-morling?_a=BAMAMiiu0","url":"https://daily.dev/sources/gunnar-morling"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/reworking-git-branches-with-git-filter-branch-gkez485pn","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"git,version-control","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Gunnar Morling","item":"https://daily.dev/sources/gunnar-morling"},{"@type":"ListItem","position":3,"name":"Reworking Git Branches with git filter-branch"}]}
```

