Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7436703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:16:55+00:00 2026-05-29T10:16:55+00:00

I got this scenario: I created a Git repository. $ git init Cloned an

  • 0

I got this scenario:

  1. I created a Git repository.

    $ git init

  2. Cloned an external repository in a sub directory. (using git-hg in my case)

    $ git hg clone lib remote_uri

  3. Added the the cloned library as submodule

    $ git submodule add lib ./lib

  4. Then I commited the changes

    $ git commit -am “added lib”

After this procedure, if I git clone this repo and git submodule init/update the new one, I get the repo and the lib.

Anyway, If I try to push the repo to a bare one, and clone from the bare to another place, the new one crashes trying to get the lib.
I tried to git submodule init in the bare, but the command doesn’t work if you doesn’t have a working copy.

Someone got any idea what can be done?

** Update **
Here is an example without the hg.

This is a way to reproduce it.
/tmp$ git clone https://github.com/gitster/git.git
/tmp$ cd git/
/tmp/git [master]$ git clone https://github.com/gitster/git.git gitrepo
/tmp/git [master]$ git submodule add ./gitrepo
/tmp/git [master]$ git commit -am "added repo"
/tmp$ cd ..
/tmp$ git clone --bare git  gitbare
/tmp$ git clone  gitbare gittest
/tmp$ cd gittest/
/tmp/gittest [master]$ git submodule init
Submodule 'gitrepo' (/tmp/gitbare/gitrepo) registered for path 'gitrepo'
/tmp/gittest [master]$ git submodule update
fatal: repository '/tmp/gitbare/gitrepo' does not exist
Clone of '/tmp/gitbare/gitrepo' into submodule path 'gitrepo' failed
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:16:56+00:00Added an answer on May 29, 2026 at 10:16 am

    You seem to be expecting the impossible. Submodules are repositories in their own right, and to be able to clone them from anywhere, there has to be an accessible repository for them, just like there does for the parent repository. You’ve added a submodule with no public URL configuration. Git isn’t going to be able to magically fetch it out of the version you stuck in that original repository.

    You need to update the URL for the submodule to something that’ll be accessible from wherever you want to clone it from. You should host it in the same way that you do your parent repository, whether that’s on a single machine, on a single network, or on GitHub.

    And by the way, your reproduction instructions are not the same as your actual use case. In the toy case you’ve posted, all you have to do is correctly add the submodule, using the public URL:

    git submodule add https://github.com/gitster/git.git gitrepo
    

    and everything will work fine. If you host the thing that you’re trying to add as a submodule in a similar way, then the appropriate version of this command will work for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a scenario like this Class Parent { Property A; } Class A
OK, so I've got this totally rare an unique scenario of a load balanced
I got stuck with this scenario. Let me explain as follows. I have a
Let's say I'm using git locally only, for web work in JavaScript. I've got
I'm using git and been working heavily on my local repository the last week.
I got this question as an assignment: Packages/Naming We have created lot of packages
Got this line of code here but its not working. private void Button_Click(object sender,
Got this site with UN/PW set via the Createuserwizard control. Client considers PW too
Got this: Table a ID RelatedBs 1 NULL 2 NULL Table b AID ID
Got this code for a viewscroller from the apple developers site. @synthesize scrollView1, scrollView2;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.