Ignore git sub-repositories and treat them as regular files

I have a huge “main” git repository with several sub-folders, which themselves are separate git repos.

I use the main repo as a sort of incremental backup system. However, the main repo always ignores any of the sub-repos and excludes them from the commits.

Is there a way to fix this and treat them as regular directories for the purpose of tracking changes?

I imagine a good way would be to temporarily “delete” any .gitignore (except the main one) files and .git folders (except the main one), just until git commit finishes on the main repo. I would even be OK with tracking the .git folders as well if that’d be easier, though I guess it’d be very inefficient.

Any thoughts?

  • Provide a password for the “git push” command in GitPython
  • Github - how to search a specific file with some conditions about the corresponding repos?
  • Git pull from my public repository not working
  • Trac component(s) referencing separate GIT repositories
  • repo/git revert to state as one month ago
  • Heroku 'Permission denied (publickey) fatal: Could not read from remote repository' woes
  • How do you use Git to retrieve just one (or a few) files from a repo?
  • Git: Push local file to a different file name in a remote repository
  • One Solution collect form web for “Ignore git sub-repositories and treat them as regular files”

    You can declare those sub-repos as submodule.

    For backup purposes, that means the main rpeo will reference the url and exact sha1 of those subrepos.
    But that would mean the subrepos would need to be pushed to their own remote ‘origin‘ repo and backed up independently: what you would record in the main rpeo is only the coherent set of git subrepos SHA1 at a given time, nothing more.

    To actually backup everything (main repo and subrepos), you would need to revert to classic incremental backup softwares.

    Git Baby is a git and github fan, let's start git clone.