Ignore git sub-repositories and treat them as regular files
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.
- What to add to git repo?
- SVN: one working copy, two repositories?
- fatal: Not a git repository (or any of the parent directories): .git on every rails command but git commands works fine
- Export git repository with history into another repository
- git push to remote repository “Could not read from remote repository”
- Joining two GIT repositories into one using SourceTree
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.
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.