git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Allow empty commits to be rebased

From
MRMihai Rusu <dizzy@google.com>
Date
Dec 24, 2010, 00:48 UTC
Message-ID
<AANLkTim4pHZ=d3XwEP_ZM8P7ZO6FbMJbMDGzssuL5kVj@mail.gmail.com>
Hi

When trying to rebase empty Git commits (git commit --allow-empty), "git rebase" (and "git rebase -i") just skip the empty commits. This may make some sense in the context of "git rebase" trying to determine if the code to be rebased already exists in "upstream" but in our case we need to rebase purely because of parent changes. Playing with "git rebase", the only way to force it to rebase empty commits was to do something like: $ git rebase -i --onto upstream HEAD~N # where N is the number of commits we want rebased

And then for every empty commit it stops as if it got a conflict, I have to issue git commit --allow-empty and then git rebase --continue (if I just run git rebase --continue as I should it skips the empty commit). If I drop "-i" or if I don't use the onto/HEAD~N trick I'm not able to rebase empty commits.

If you don't think that "git rebase" should support rebasing of empty commits by default then please consider adding an --allow-empty argument to enable such functionality.

Thanks!
-- 
Mihai Rusu
Message 1 of 1 in “Allow empty commits to be rebased”
  1. Mihai RusuDec 24, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.