git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shourya Shukla <shouryashukla.oo@gmail.com>
To: bgoglin@free.fr
Cc: git@vger.kernel.org, Shourya Shukla <shouryashukla.oo@gmail.com>
Subject: Re: fatal: cannot rebase with locally recorded submodule modifications
Date: Sat,  8 Feb 2020 03:34:03 +0530	[thread overview]
Message-ID: <20200207220403.28961-1-shouryashukla.oo@gmail.com> (raw)
In-Reply-To: <660c39af-d0f2-5e4c-66a0-5c78b646b023@free.fr>

Hello Brice,

The error you are facing here is actually a bug in the
'git pull' command[1]. When one tries to use the
'--recurse-submodules' tag with the command, it tends to fail.

> Why is failing here?

Going into a bit detail of 'git pull', the command actually
is a combination of 'git fetch' and 'git merge'(unless any
other tag is specified i.e. 'rebase' here which would mean
a fetch followed by a rebase). Quoting from the documentation:

> Using --recurse-submodules can only fetch new commits in already
checked out submodules right now

Using the '--recurse-submodules' tag will try merging/rebasing any
changes(updations, additions, deletions, etc.) made to the fetched
submodule(s) from upstream, i.e. the _un-checked out_ submodules into
our local repository which will cause the error to be thrown as it is
not supported right now. This will therefore create the detached HEAD
just like the one you obtained.

The "workaround" is to do a 'git fetch' and then merge again after the
'git pull <tag> --recurse-submodules'.

The presence/absence of 'git reset --hard' before the pull  won't create
any difference to this error in my opinion.

Regards,
Shourya Shukla

[1]: https://git-scm.com/docs/git-pull#_bugs


  reply	other threads:[~2020-02-07 22:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 20:50 fatal: cannot rebase with locally recorded submodule modifications Brice Goglin
2020-02-07 22:04 ` Shourya Shukla [this message]
2020-11-14  0:32   ` Philippe Blain
2020-11-13 23:47 ` Philippe Blain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200207220403.28961-1-shouryashukla.oo@gmail.com \
    --to=shouryashukla.oo@gmail.com \
    --cc=bgoglin@free.fr \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).