Search code examples
gitgit-rebase

Automatically skip empty commits when using git rebase


Usually, you have to do git rebase --skip, it would be nice if there was a switch to automatically skip over these empty commits. Anyone know how to do this?


Solution

  • Very old topic, but for me was the first result on the search engine.

    I finally found there is a --empty parameter that can take one of the following values: keep, drop, and ask.

    Link to the documentation: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---emptydropkeepask

    So you now can simply do git rebase ... --empty=drop