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

  • SEARCH
  • Home
  • 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 8352611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:00:41+00:00 2026-06-09T09:00:41+00:00

I am using git bundle to back up git repositories. In recent versions of

  • 0

I am using git bundle to back up git repositories. In recent versions of git the repository metadata of a submodule are stored in .git/modules of the parent repository as opposed to before when it was stored in a .git directory right in the submodule.

When git-bundle is run in a submodule, it creates a bundle of the parent repo, omitting the submodules.

Anyone who can shed light on this?
How can I make a git bundle of a submodule?

reference:
question on the git mailing list

edit:

After reading that for sschuberth it works, I wrote a script to test and can verify that it works. I have a backup script that relied on verifying the existence of a .git directory in order to know if it is in the top level dir of a repository and that thus broke when submodules started using .git files. If anyone knows what the recommended way is to garantee that you are in the top level folder of a repository, I’m interested. I don’t know how I missed this.

Just in case it might interest someone who has to write test scripts for submodules, this is the script I used:

#!/bin/bash

git --version

mkdir super
mkdir subRemote

touch super/superFile.txt
touch subRemote/subFile.txt

cd super

   git init
   git add --all
   git commit -am"Initial commit"

cd ..


cd subRemote

   git init
   git add --all
   git commit -am"Initial commit"

cd ..


cd super

   git submodule add ../subRemote/.git
   git add --all
   git commit -am"added submodule"
   git submodule update
   echo -e "\ngit log in super:"
   git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all


   cd subRemote

      echo -e "\ngit bundle:"
      git bundle create ../../submoduleBundle --all --remotes

   cd ..

cd ..


git clone --mirror submoduleBundle bundledSub/.git

cd bundledSub

   git config core.bare false
   git config core.logallrefupdates true
   git remote rm origin
   git checkout

cd ..


#------------------------------------------------

cd super

   echo -e "\nfiles in super":
   ls -alh

cd ..


cd super/subRemote

   echo -e "\nfiles in super/subRemote":
   ls -alh

cd ../..


cd bundledSub

   echo -e "\nfiles in bundledSub":
   ls -alh

cd ..
  • 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-06-09T09:00:42+00:00Added an answer on June 9, 2026 at 9:00 am

    Are you sure that running git submodule update succeeded and the .git file (not directory) in the submodule exists? In my tests bundling submodules works fine with version 1.7.9.6.

    If it still fails for you for some reason, a work-around would be to clone the submodule’s repository into its own working tree and run git bundle from there (for the commit as shown by git submodule status in the superproject).

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

Sidebar

Related Questions

Possible Duplicate: Using Git with an existing Xcode project Setting up a git repository
I've decided to start versioning my project the Apple way, using Bundle versions string,
Using gitosis to configure repositories works quite well. However, manually creating every repository is
i get this error while using bundle install in ROR. Fetching git://github.com/pengwynn/linkedin.git fatal: Unable
Using Git, my editor for commits is Vim. I'm constantly doing a poor job
Using git , if I make git branch --all I can see all remotes
Using Git, how can you find the difference between the current and the last
When using git submodules, what is the preferred way of doing customizations? Should I...
I'm using git in a project with multiple branches used concurrently, that is: A
We are using git for version control and right now we are getting a

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.