{"thread":{"id":"55043","subject":"Can not rebase to first commit","startedAt":"2021-01-25T10:49:51Z","lastAt":"2021-01-26T22:19:54Z","messageCount":7,"participants":["Eugen Konkov","Matheus Tavares Bernardino","Taylor Blau","Thomas Braun","Martin Ågren","Kevin Daudt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"415192","messageId":"1327609829.20210125123816@yandex.ru","threadId":"55043","inReplyTo":null,"subject":"Can not rebase to first commit","fromName":"Eugen Konkov","fromEmail":"kes-kes@yandex.ru","sentAt":"2021-01-25T10:38:16Z","receivedAt":"2021-01-25T10:49:51Z","isPatch":false,"sender":{"key":"kes-kes@yandex.ru","avatar":null},"body":"I can not rebase to first commit.\n\nThis is how to reproduce:\n\nkes@work ~/work/projects/general/Auth $ git tree\n* 67857d5 (HEAD -> dev) asdf\n* 1e99034 (local/dev) Initial commit\nkes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^\nfatal: invalid upstream '1e99034^'\n\n\ngit --version\ngit version 2.30.0\n\n--\nBest regards,\nEugen Konkov \n\n"},{"id":"415194","messageId":"CAHd-oW6=CFNGyW30pDhjwgwMcDFeqFoad=J6DkHruaeA75SzCw@mail.gmail.com","threadId":"55043","inReplyTo":"1327609829.20210125123816@yandex.ru","subject":"Re: Can not rebase to first commit","fromName":"Matheus Tavares Bernardino","fromEmail":"matheus.bernardino@usp.br","sentAt":"2021-01-25T16:53:55Z","receivedAt":"2021-01-25T16:55:39Z","isPatch":false,"sender":{"key":"matheus.tavb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701583?v=4"},"body":"Hi, Eugen\n\nOn Mon, Jan 25, 2021 at 7:50 AM Eugen Konkov <kes-kes@yandex.ru> wrote:\n>\n> I can not rebase to first commit.\n>\n> This is how to reproduce:\n>\n> kes@work ~/work/projects/general/Auth $ git tree\n> * 67857d5 (HEAD -> dev) asdf\n> * 1e99034 (local/dev) Initial commit\n> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^\n> fatal: invalid upstream '1e99034^'\n\n'1e99034^' means \"the first parent of 1e99034\". However, this is the\nroot commit of your branch, so it has no parent. That's why rebase\ncomplained about  '1e99034^' being invalid. To rebase this commit you\ncan instead use the --root option.\n\nThanks,\nMatheus\n"},{"id":"415263","messageId":"YA7T8fo5zngSD+zd@nand.local","threadId":"55043","inReplyTo":"1327609829.20210125123816@yandex.ru","subject":"Re: Can not rebase to first commit","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2021-01-25T14:21:56Z","receivedAt":"2021-01-26T02:52:11Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Jan 25, 2021 at 12:38:16PM +0200, Eugen Konkov wrote:\n> I can not rebase to first commit.\n>\n> This is how to reproduce:\n>\n> kes@work ~/work/projects/general/Auth $ git tree\n> * 67857d5 (HEAD -> dev) asdf\n> * 1e99034 (local/dev) Initial commit\n\n(Unrelated to your question, but I assume that 'git tree' is an alias of\n'git log --oneline --graph' by the looks of it).\n\n> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^\n> fatal: invalid upstream '1e99034^'\n\nYes, this is because you're asking to rebase your branch onto the parent\nof 1e99034, which doesn't exist because 1e99034 is the \"root\" commit and\ntherefore has no parents.\n\n'git rebase' has a special option for exactly this case, which is\n'--root'. By replacing '1e99034^' with '--root', you should be able to\ndo what you want.\n\nThanks,\nTaylor\n"},{"id":"415324","messageId":"13e03215-76ad-ad8a-0da3-e18088f69416@virtuell-zuhause.de","threadId":"55043","inReplyTo":"1327609829.20210125123816@yandex.ru","subject":"Re: Can not rebase to first commit","fromName":"Thomas Braun","fromEmail":"thomas.braun@virtuell-zuhause.de","sentAt":"2021-01-25T13:24:06Z","receivedAt":"2021-01-26T20:53:30Z","isPatch":false,"sender":{"key":"thomas.braun@virtuell-zuhause.de","avatar":"https://avatars.githubusercontent.com/u/1185677?v=4"},"body":"On 1/25/2021 11:38 AM, Eugen Konkov wrote:\n> I can not rebase to first commit.\n> \n> This is how to reproduce:\n> \n> kes@work ~/work/projects/general/Auth $ git tree\n> * 67857d5 (HEAD -> dev) asdf\n> * 1e99034 (local/dev) Initial commit\n> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^\n> fatal: invalid upstream '1e99034^'\n\nSee `git rebase --root` where the documentation says \"This allows you to\nrebase the root commit(s) on a branch.\".\n\n"},{"id":"415326","messageId":"CAN0heSp-bd-Dy4rT7DmEx3TQELoCr7a81WQLsT7wWdmbm5ZQ1g@mail.gmail.com","threadId":"55043","inReplyTo":"1327609829.20210125123816@yandex.ru","subject":"Re: Can not rebase to first commit","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2021-01-25T11:30:46Z","receivedAt":"2021-01-26T20:54:08Z","isPatch":false,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On Mon, 25 Jan 2021 at 11:53, Eugen Konkov <kes-kes@yandex.ru> wrote:\n>\n> I can not rebase to first commit.\n>\n> This is how to reproduce:\n>\n> kes@work ~/work/projects/general/Auth $ git tree\n> * 67857d5 (HEAD -> dev) asdf\n> * 1e99034 (local/dev) Initial commit\n> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^\n> fatal: invalid upstream '1e99034^'\n\nThe commit 1e99034 has no parent, so 1e99034^ errors out.\n\nTry the `--root` option. That should do what you want.\n\nMartin\n"},{"id":"415327","messageId":"YA6qDe07eHNKBE6l@alpha","threadId":"55043","inReplyTo":"1327609829.20210125123816@yandex.ru","subject":"Re: Can not rebase to first commit","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2021-01-25T11:22:53Z","receivedAt":"2021-01-26T20:54:39Z","isPatch":false,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"On Mon, Jan 25, 2021 at 12:38:16PM +0200, Eugen Konkov wrote:\n> I can not rebase to first commit.\n> \n> This is how to reproduce:\n> \n> kes@work ~/work/projects/general/Auth $ git tree\n> * 67857d5 (HEAD -> dev) asdf\n> * 1e99034 (local/dev) Initial commit\n> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^\n> fatal: invalid upstream '1e99034^'\n> \n> \n> git --version\n> git version 2.30.0\n> \n> --\n> Best regards,\n> Eugen Konkov \n> \n\nThis is because the first commit (1e99034) does not have a parent, so\n1e99034^ cannot be resolved.\n\ngit rebase does however have an option for this: git rebase -i --root.\nThat allows you to rebase the root commit.\n\nHope this helps, Kevin\n"},{"id":"415346","messageId":"789931525.20210126192600@yandex.ru","threadId":"55043","inReplyTo":"CAHd-oW6=CFNGyW30pDhjwgwMcDFeqFoad=J6DkHruaeA75SzCw@mail.gmail.com","subject":"Re: Can not rebase to first commit","fromName":"Eugen Konkov","fromEmail":"kes-kes@yandex.ru","sentAt":"2021-01-26T17:26:00Z","receivedAt":"2021-01-26T22:19:54Z","isPatch":false,"sender":{"key":"kes-kes@yandex.ru","avatar":null},"body":"Thank you for all.\n\nI always thought that 1e99034^ means: including this commit\n\nThanks for help\n\n"}]}