{"id":23763836,"url":"https://github.com/tomashubelbauer/git-submodule","last_synced_at":"2026-04-21T03:31:42.247Z","repository":{"id":107986115,"uuid":"227195629","full_name":"TomasHubelbauer/git-submodule","owner":"TomasHubelbauer","description":"Investigating if a Git submodule can be added by hand","archived":false,"fork":false,"pushed_at":"2022-04-14T20:20:08.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T20:03:45.724Z","etag":null,"topics":["git","gitmodules","submodule"],"latest_commit_sha":null,"homepage":"","language":"Markdown","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TomasHubelbauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-10T19:06:30.000Z","updated_at":"2022-04-17T09:57:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"3852b919-bec9-4a0f-abd9-ec5a7fc24411","html_url":"https://github.com/TomasHubelbauer/git-submodule","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TomasHubelbauer/git-submodule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit-submodule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit-submodule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit-submodule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit-submodule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomasHubelbauer","download_url":"https://codeload.github.com/TomasHubelbauer/git-submodule/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit-submodule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32075222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","gitmodules","submodule"],"created_at":"2024-12-31T22:13:39.041Z","updated_at":"2026-04-21T03:31:42.229Z","avatar_url":"https://github.com/TomasHubelbauer.png","language":"Markdown","readme":"# Git Submodule\n\nIs it possible to add a submodule to a Git repository by hand? That is, just by\nediting files in a text editor, not touching the Git CLI at all?\n\n[I don't think so](https://stackoverflow.com/a/59273805/2715716):\n\nWhen a submodule is added, Git creates `.submodules` file and for a submodule\nnamed `git-submodule`, it will contain something like this:\n\n```\n[submodule \"git-submodule\"]\n\tpath = git-submodule\n\turl = https://github.com/TomasHubelbauer/git-submodule\n```\n\nThe same is added to `.git/config` after the existing content of that file.\n\nA directory for the submodule named after the submodule is created in\n`.git/modules`. This folder is nearly identical to the the `.git` directory of\nthe actual submodule repository, but it doesn't contain the actual `objects`\n(instead the submodule data is checked out to its directory and its metadata\nare here).\n\nThis means that theoretically, you might be able to add a submodule by hand\nwithout using `git submodule add`, but you would have to recreate all these\nconfig files.\n\nBut one can still imagine cloning the submodule repository to a separate\ndirectory and copying its `.git` over to this one. That _might_ work.\n\nHowever, adding a submodule also changes the index, `.git/index`, so you would\nhave to manually update this hash as well, and at this point, you're reimplementing\nGit, but manually.\n\nAs a result, I don't believe it is anywhere near practical to add a Git submodule\nby hand.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fgit-submodule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomashubelbauer%2Fgit-submodule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fgit-submodule/lists"}