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?
Sometimes during a Git rebase process, you may encounter some conflicting commits and wants to skip the specific commit for some reason. You can do that by passing the --skip flag in the git rebase command.
You can run git rebase --skip to completely skip the commit. That means that none of the changes introduced by the problematic commit will be included. It is very rare that you would choose this option. You can fix the conflict.
The Rebase Option But, instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch.
For each change you make, you'll need to perform a new commit, and you can do that by entering the git commit --amend command. When you're finished making all your changes, you can run git rebase --continue . As before, Git is showing the commit message for you to edit.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With