{"id":15394958,"url":"https://github.com/panquesito7/submodules-alternative","last_synced_at":"2025-04-15T23:54:06.562Z","repository":{"id":103079832,"uuid":"569939284","full_name":"Panquesito7/submodules-alternative","owner":"Panquesito7","description":"An easy-to-use Git modules alternative to make the cloning process easier.","archived":false,"fork":false,"pushed_at":"2023-11-08T08:33:02.000Z","size":107,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T03:05:59.973Z","etag":null,"topics":["action","action-composite","clone","cloning","composite","composite-action","git","git-modules","git-subtree","gitmodule","gitmodules","gitsubmodules","gitsubtree","hacktoberfest","lua","modules","repositories","script","submodules","subtree"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Panquesito7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-24T01:00:18.000Z","updated_at":"2023-12-24T17:46:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"e84431fe-3c71-4f98-8dba-dc82be5c72d0","html_url":"https://github.com/Panquesito7/submodules-alternative","commit_stats":{"total_commits":108,"total_committers":1,"mean_commits":108.0,"dds":0.0,"last_synced_commit":"67d0bc8ffcf0f2f51a39f1acf0cafba2515899fd"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Panquesito7%2Fsubmodules-alternative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Panquesito7%2Fsubmodules-alternative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Panquesito7%2Fsubmodules-alternative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Panquesito7%2Fsubmodules-alternative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Panquesito7","download_url":"https://codeload.github.com/Panquesito7/submodules-alternative/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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":["action","action-composite","clone","cloning","composite","composite-action","git","git-modules","git-subtree","gitmodule","gitmodules","gitsubmodules","gitsubtree","hacktoberfest","lua","modules","repositories","script","submodules","subtree"],"created_at":"2024-10-01T15:25:02.576Z","updated_at":"2025-04-15T23:54:06.543Z","avatar_url":"https://github.com/Panquesito7.png","language":"Lua","readme":"# Submodules Alternative\n\n[![Verify that the script works](https://github.com/Panquesito7/submodules-alternative/actions/workflows/test-script.yml/badge.svg)](https://github.com/Panquesito7/submodules-alternative/actions/workflows/test-script.yml)\n[![LuaCheck](https://github.com/Panquesito7/submodules-alternative/actions/workflows/luacheck.yml/badge.svg)](https://github.com/Panquesito7/submodules-alternative/actions/workflows/luacheck.yml)\n\n[![Submodules Alternative](https://socialify.git.ci/Panquesito7/submodules-alternative/image?description=1\u0026descriptionEditable=Easy-to-use%20Git%20modules%20alternative\u0026font=Source%20Code%20Pro\u0026issues=1\u0026language=1\u0026name=1\u0026owner=1\u0026pattern=Circuit%20Board\u0026stargazers=1\u0026theme=Auto)](https://github.com/Panquesito7/submodules-alternative)\n\nAn easy-to-use Git (Sub)modules alternative to make the cloning process easier.\\\n**The project is still WIP and still contains minor bugs. It is recommended to use it in small projects until the tool is fairly stable.**\n\n## What's the difference?\n\n- Cloning repositories is now super easier: anyone can clone your repository **without the need for Git**. No more `clone recursive` or `submodule update` commands!\n- Subtree addition/update is automated by GitHub Actions (if desired), making it easier to integrate into your projects.\n- Lightweight and documented codebase written in [Lua](https://www.lua.org/) v5.3.3.\n- Git Submodules can sometimes be messy or confusing, which this tool aims to solve.\n- Lets you choose the desired branch of the repository, unlike Git Submodules which automatically chooses the default branch.\n- Easily take a look at the changes **directly in the PR** without extra effort. Git Submodules changes cannot be seen via the PR diff.\n- The scripts support both Linux (preferred) and Windows, which means that you can easily run the scripts on your machine or [Gitpod](https://www.gitpod.io) without using GitHub Actions.\n\u003c!-- - Easily specify which files are ignored at the moment of updating the repositories. This is very useful if you want to modify a repository/submodule. --\u003e\n\n## Usage\n\n1. Create a new file named `repos.lua` (or as you desire) with all your selected repositories ([template](https://github.com/Panquesito7/submodules-alternative/blob/main/repos-template.lua) file). You can place it in any directory, just make sure to specify the directory in your workflow (see the next step).\n\nYour `repos.lua` file should look similar to the following.\n\n```lua\nlocal config = {\n    labels_fetch = \"repo-fetch,dependencies\"\n    labels_update = \"dependencies\",\n}\n\nlocal repos = {\n    {\n        name = \"opencv\",\n        url = \"https://github.com/opencv/opencv\",\n        dir = \"libs/\",\n        def_branch = \"master\"\n    },\n    {\n        name = \"texto\",\n        url = \"https://github.com/realstealthninja/texto\",\n        dir = \"libs/\"\n    },\n    {\n        name = \"panqkart\",\n        url = \"https://github.com/panqkart/panqkart\",\n        dir = \"games/\"\n    }\n}\n\n-- Fully needed, so that the scripts can access the configurations.\nreturn {\n    repos = repos,\n    config = config\n}\n```\n\n### GitHub Actions\n\nThis GitHub Action workflow will automatically update or clone the desired repositories.\\\nYou can choose to update, clone, or do both actions. You can also configure how the script works.\n\n```yml\nname: Submodules Alternative\non:\n  schedule:\n  #        ┌───────────── minute (0 - 59)\n  #        │  ┌───────────── hour (0 - 23)\n  #        │  │ ┌───────────── day of the month (1 - 31)\n  #        │  │ │ ┌───────────── month (1 - 12 or JAN-DEC)\n  #        │  │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)\n  #        │  │ │ │ │\n  #        │  │ │ │ │\n  #        │  │ │ │ │\n  #        *  * * * *\n  - cron: '0 0 * * 1' # This would run weekly on Monday at 00:00 UTC\n  workflow_dispatch: # This allows you to manually run the workflow whenever you want.\njobs:\n  update-repos:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0 # This pulls changes before doing any changes\n      - uses: Panquesito7/submodules-alternative@v1.7.0\n        with:\n          repos_filename: repos.lua                   # Both `repos.lua` and `repos` will work.\n          use_pr: true                                # Whether to create a pull request when updating/adding the repositories.\n          branch_name: repo-update                    # The branch name to use (only if `use_pr` is enabled).\n          commit_message: 'Update'                    # Commit message used when adding new repositories.\n          commit_message_update: 'Bump repositories'  # Commit message used when updating all the repositories.\n          add_repos: false                            # If enabled, this will clone all the repositories listed in your repos file.\n          update_repos: true                          # When enabled, this will attempt to update all the repositories.\n          squash_commits: false                       # Whether to squash all commits or not on every repository update/addition. Cannot be used if `one_pr` is disabled.\n          one_pr: false                               # Creates one single PR for everything if enabled. Works only for `update_repos` if disabled.\n```\n\n**Always use single-quoting for commit messages if you want to include special symbols such as `!`.**\n\nAfter a PR is merged, its branch won't be automatically deleted, thus, the script will fail if there's a new update when the outdated branch still exists.\\\nIf you want your branches to automatically delete after being merged, you should consider one of the following options:\n\n1. Automatically [delete branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches) on PR merging (recommended).\n2. Manually delete the branches (not recommended).\n3. Use a GitHub Action like [Delete Merged Branch](https://github.com/SvanBoxel/delete-merged-branch).\n\nYou can also configure to run the workflow manually by using `workflow_dispatch` instead of `schedule`.\\\nFor more information about Cron, you can check [CronHub](https://crontab.cronhub.io/).\n\n### Manually\n\n1. Run `fetch-repos.lua` to clone all the repositories automatically.\n\n\u003e **Note**\n\u003e\n\u003e You will need to install Lua v5.3.3 in your\\\n\u003e machine in case you do not have it installed.\\\n\u003e Git Software is also required to run a few commands.\n\u003e\n\u003e Download Lua: \u003chttps://www.lua.org/download.html\u003e\\\n\u003e Download Git Software: \u003chttps://git-scm.com/downloads\u003e\n\u003e\n\u003e **Both `fetch-repos.lua` and `update-repos.lua` require\\\n\u003e `helper-functions.lua` for extra functions and safety checks.**\n\n```bash\nlua fetch-repos.lua \u003crepos_filename\u003e \u003csquash_commits\u003e \u003ccommit_message\u003e\n```\n\n2. Once done, you can push changes. Committing is already done by the script.\n\n```bash\ngit push\n```\n\n**Please note that commit messages should include quoting (`''` or `\"\"`), else, the script will detect it as multiple parameters.**\n\n3. Done! All of your subtrees are now available in your project and can be updated later on. 🎉\n\nIf you've updated your subtrees list, you can always run the script again and it'll clone the new subtrees.\n\n## Updating the subtrees\n\nBy using GitHub Actions, the subtrees will be updated automatically.\\\nIf you wish to do that manually, you can run the following script.\n\n**Remember to use (single-)quoting around the commit message!**\n\n```bash\nlua update-repos.lua \u003crepos_filename\u003e \u003ccommit_message\u003e \u003csquash_commits\u003e\n```\n\nAfter running the script, you can push changes to the desired branch.\\\nThe script already takes care of committing everything.\n\n## To-do\n\nAll the pending work and to-do list can be found here: \u003chttps://github.com/users/Panquesito7/projects/3\u003e\n\n## License\n\nSee [`LICENSE.md`](LICENSE.md) for full information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanquesito7%2Fsubmodules-alternative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanquesito7%2Fsubmodules-alternative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanquesito7%2Fsubmodules-alternative/lists"}