git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* How to checkout a revision that contains a deleted submodule?
@ 2020-09-19  9:03 Luke Diamand
  2020-09-20  9:44 ` Luke Diamand
  0 siblings, 1 reply; 7+ messages in thread
From: Luke Diamand @ 2020-09-19  9:03 UTC (permalink / raw)
  To: Git Users

Maybe this is a FAQ, but I couldn't figure it out!

I have a repo which has a couple of submodules.

At some point in the past I deleted one of those submodules:

    git rm sub2
    git add -u
    git commit -m 'Deleting sub2'
    git push origin
    ...
    ... more commits and pushes...

Now I go and clone the head revision. This gives me a clone which has
nothing present in .git/modules/sub2.
    login on some other machine
    git clone git@my.repo:thing
    cd thing
    ls .git/modules
    <sub2 not present>

So when I go and checkout an old revision where sub2 is still around I get:
    git checkout oldrevision
    fatal: not a git repository: sub2/../.git/modules/sub2

What am I doing wrong?
What set of commands do I need to use to ensure that this will always
do the right thing?

Thanks
Luke

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

end of thread, other threads:[~2020-09-22  4:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-19  9:03 How to checkout a revision that contains a deleted submodule? Luke Diamand
2020-09-20  9:44 ` Luke Diamand
2020-09-20 18:02   ` Kaartic Sivaraam
2020-09-20 20:52     ` Luke Diamand
2020-09-21 23:14     ` Philippe Blain
2020-09-22  4:32       ` Luke Diamand
2020-09-21 22:46   ` Philippe Blain

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).