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

Re: Can not rebase to first commit

From
Taylor Blau <me@ttaylorr.com>
Date
Jan 25, 2021, 14:21 UTC
Message-ID
<YA7T8fo5zngSD+zd@nand.local>
In-Reply-To
<1327609829.20210125123816@yandex.ru>
On Mon, Jan 25, 2021 at 12:38:16PM +0200, Eugen Konkov wrote:
Show 7 quoted lines
> I can not rebase to first commit.
>
> This is how to reproduce:
>
> kes@work ~/work/projects/general/Auth $ git tree
> * 67857d5 (HEAD -> dev) asdf
> * 1e99034 (local/dev) Initial commit

(Unrelated to your question, but I assume that 'git tree' is an alias of 'git log --oneline --graph' by the looks of it).

> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^
> fatal: invalid upstream '1e99034^'

Yes, this is because you're asking to rebase your branch onto the parent of 1e99034, which doesn't exist because 1e99034 is the "root" commit and therefore has no parents.

'git rebase' has a special option for exactly this case, which is '--root'. By replacing '1e99034^' with '--root', you should be able to do what you want.

Thanks, Taylor

Previous: Eugen KonkovNext: Thomas Braun
Message 4 of 7 in “Can not rebase to first commit”
  1. Eugen KonkovJan 25, 2021
  2. Matheus Tavares BernardinoJan 25, 2021
  3. Eugen KonkovJan 26, 2021
  4. Taylor BlauJan 25, 2021
  5. Thomas BraunJan 25, 2021
  6. Martin ÅgrenJan 25, 2021
  7. Kevin DaudtJan 25, 2021

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.