git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Can not rebase to first commit
@ 2021-01-25 10:38 Eugen Konkov
  2021-01-25 11:22 ` Kevin Daudt
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Eugen Konkov @ 2021-01-25 10:38 UTC (permalink / raw)
  To: Git Mailing List

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


git --version
git version 2.30.0

--
Best regards,
Eugen Konkov 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can not rebase to first commit
  2021-01-25 10:38 Can not rebase to first commit Eugen Konkov
@ 2021-01-25 11:22 ` Kevin Daudt
  2021-01-25 11:30 ` Martin Ågren
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Kevin Daudt @ 2021-01-25 11:22 UTC (permalink / raw)
  To: Eugen Konkov; +Cc: Git Mailing List

On Mon, Jan 25, 2021 at 12:38:16PM +0200, Eugen Konkov wrote:
> 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
> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^
> fatal: invalid upstream '1e99034^'
> 
> 
> git --version
> git version 2.30.0
> 
> --
> Best regards,
> Eugen Konkov 
> 

This is because the first commit (1e99034) does not have a parent, so
1e99034^ cannot be resolved.

git rebase does however have an option for this: git rebase -i --root.
That allows you to rebase the root commit.

Hope this helps, Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can not rebase to first commit
  2021-01-25 10:38 Can not rebase to first commit Eugen Konkov
  2021-01-25 11:22 ` Kevin Daudt
@ 2021-01-25 11:30 ` Martin Ågren
  2021-01-25 13:24 ` Thomas Braun
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Martin Ågren @ 2021-01-25 11:30 UTC (permalink / raw)
  To: Eugen Konkov; +Cc: Git Mailing List

On Mon, 25 Jan 2021 at 11:53, Eugen Konkov <kes-kes@yandex.ru> wrote:
>
> 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
> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^
> fatal: invalid upstream '1e99034^'

The commit 1e99034 has no parent, so 1e99034^ errors out.

Try the `--root` option. That should do what you want.

Martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can not rebase to first commit
  2021-01-25 10:38 Can not rebase to first commit Eugen Konkov
  2021-01-25 11:22 ` Kevin Daudt
  2021-01-25 11:30 ` Martin Ågren
@ 2021-01-25 13:24 ` Thomas Braun
  2021-01-25 14:21 ` Taylor Blau
  2021-01-25 16:53 ` Matheus Tavares Bernardino
  4 siblings, 0 replies; 7+ messages in thread
From: Thomas Braun @ 2021-01-25 13:24 UTC (permalink / raw)
  To: Eugen Konkov, Git Mailing List

On 1/25/2021 11:38 AM, Eugen Konkov wrote:
> 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
> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^
> fatal: invalid upstream '1e99034^'

See `git rebase --root` where the documentation says "This allows you to
rebase the root commit(s) on a branch.".


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can not rebase to first commit
  2021-01-25 10:38 Can not rebase to first commit Eugen Konkov
                   ` (2 preceding siblings ...)
  2021-01-25 13:24 ` Thomas Braun
@ 2021-01-25 14:21 ` Taylor Blau
  2021-01-25 16:53 ` Matheus Tavares Bernardino
  4 siblings, 0 replies; 7+ messages in thread
From: Taylor Blau @ 2021-01-25 14:21 UTC (permalink / raw)
  To: Eugen Konkov; +Cc: Git Mailing List

On Mon, Jan 25, 2021 at 12:38:16PM +0200, Eugen Konkov wrote:
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can not rebase to first commit
  2021-01-25 10:38 Can not rebase to first commit Eugen Konkov
                   ` (3 preceding siblings ...)
  2021-01-25 14:21 ` Taylor Blau
@ 2021-01-25 16:53 ` Matheus Tavares Bernardino
  2021-01-26 17:26   ` Eugen Konkov
  4 siblings, 1 reply; 7+ messages in thread
From: Matheus Tavares Bernardino @ 2021-01-25 16:53 UTC (permalink / raw)
  To: Eugen Konkov; +Cc: Git Mailing List

Hi, Eugen

On Mon, Jan 25, 2021 at 7:50 AM Eugen Konkov <kes-kes@yandex.ru> wrote:
>
> 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
> kes@work ~/work/projects/general/Auth $ git rebase -i --autostash --rebase-merges 1e99034^
> fatal: invalid upstream '1e99034^'

'1e99034^' means "the first parent of 1e99034". However, this is the
root commit of your branch, so it has no parent. That's why rebase
complained about  '1e99034^' being invalid. To rebase this commit you
can instead use the --root option.

Thanks,
Matheus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can not rebase to first commit
  2021-01-25 16:53 ` Matheus Tavares Bernardino
@ 2021-01-26 17:26   ` Eugen Konkov
  0 siblings, 0 replies; 7+ messages in thread
From: Eugen Konkov @ 2021-01-26 17:26 UTC (permalink / raw)
  To: Matheus Tavares Bernardino; +Cc: Git Mailing List

Thank you for all.

I always thought that 1e99034^ means: including this commit

Thanks for help


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-26 22:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 10:38 Can not rebase to first commit Eugen Konkov
2021-01-25 11:22 ` Kevin Daudt
2021-01-25 11:30 ` Martin Ågren
2021-01-25 13:24 ` Thomas Braun
2021-01-25 14:21 ` Taylor Blau
2021-01-25 16:53 ` Matheus Tavares Bernardino
2021-01-26 17:26   ` Eugen Konkov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).