{"id":19607242,"url":"https://github.com/robocorp/example-use-git-submodule-for-shared-code","last_synced_at":"2025-02-26T16:44:59.796Z","repository":{"id":103903550,"uuid":"377117160","full_name":"robocorp/example-use-git-submodule-for-shared-code","owner":"robocorp","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-20T07:55:31.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-09T09:27:06.020Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"RobotFramework","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/robocorp.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}},"created_at":"2021-06-15T10:03:45.000Z","updated_at":"2024-11-30T01:44:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"6223f346-186b-4e32-afe5-07f514c5c03d","html_url":"https://github.com/robocorp/example-use-git-submodule-for-shared-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-use-git-submodule-for-shared-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-use-git-submodule-for-shared-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-use-git-submodule-for-shared-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-use-git-submodule-for-shared-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robocorp","download_url":"https://codeload.github.com/robocorp/example-use-git-submodule-for-shared-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240895246,"owners_count":19874951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-11T10:09:36.551Z","updated_at":"2025-02-26T16:44:59.791Z","avatar_url":"https://github.com/robocorp.png","language":"RobotFramework","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Use Git submodule for shared robot code\n\nThis example robot code repository includes another robot repository (https://github.com/robocorp/example-shared-robot-framework-keywords-and-libraries) as a [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules).\n\nThe included repository contains (fictional) common shared code used by many robot projects. Instead of copying \u0026 pasting the code into each robot project that needs it, isolating and sharing the common code between the robots might make sense!\n\nThis project was created using [RCC](https://github.com/robocorp/rcc) and the standard Robot Framework template.\n\nThe robot includes the shared robot code from the other repository as a Git submodule. The submodule is stored in the `shared` directory.\n\nThe `shared` Git submodule in this project was created with the `git submodule add` command:\n\n```bash\ngit submodule add https://github.com/robocorp/example-shared-robot-framework-keywords-and-libraries shared\n```\n\nThe `.gitmodules` file defines the path and the URL to the included repository:\n\n```bash\n[submodule \"shared\"]\n\tpath = shared\n\turl = https://github.com/robocorp/example-shared-robot-framework-keywords-and-libraries\n```\n\nSee the `tasks.robot` file for examples of importing and using the shared code.\n\n## How to clone this project, including the Git submodule?\n\nTo test and clone this project, including the Git submodule, you can use the following command:\n\n```bash\ngit clone --recurse-submodules git@github.com:robocorp/example-use-git-submodule-for-shared-code.git\n```\n\n\u003e The `--recurse-submodules` option handles cloning the submodule. See the [Git submodule documentation](https://git-scm.com/book/en/v2/Git-Tools-Submodules) for more information.\n\n## How to pull the upstream changes to the submodule?\n\nTo pull the upstream changes to the submodule, use the following command:\n\n```bash\ngit submodule update --remote\n```\n\n## Notes\n\nThe Git submodule strategy works for code-sharing, but there are some caveats. Control Room does not automatically clone the submodules at the time of writing, and there is no way to run manual cloning commands in Control Room.\n\nIf you use Git submodules, you can still upload your robot to Control Room using the upload functionality in Robocorp Lab, VS Code, or RCC. Since the upload creates a zip package with the project contents, the zip also contains the submodules!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-use-git-submodule-for-shared-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobocorp%2Fexample-use-git-submodule-for-shared-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-use-git-submodule-for-shared-code/lists"}