---
date: "2020-09-09"
---

I needed to rebuild some git history today. It's never a fun task.

What I found while doing it, is that I was losing merge commits. I found this out to late, after taking a much less efficient approach. But if I ever encounter this problem in the future, the `--keep-empty` flag will be helpful. As in

```bash
git rebase -interactive --keep-empty upstream
```
