{"id":21089314,"url":"https://github.com/f3rno64/mass-git-scripts","last_synced_at":"2025-05-16T12:32:03.253Z","repository":{"id":224313741,"uuid":"762974633","full_name":"f3rno64/mass-git-scripts","owner":"f3rno64","description":"A collection of scripts for working with a few or a large number of git repos at once.","archived":false,"fork":false,"pushed_at":"2024-03-06T00:45:25.000Z","size":549,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T12:12:59.635Z","etag":null,"topics":["bash","bash-script","git","git-utils","scripts","utilities"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f3rno64.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-25T08:04:25.000Z","updated_at":"2024-12-30T22:29:14.000Z","dependencies_parsed_at":"2024-03-06T01:43:08.890Z","dependency_job_id":"70d5969e-3f8d-43b2-9782-39aabfd59980","html_url":"https://github.com/f3rno64/mass-git-scripts","commit_stats":null,"previous_names":["f3rno64/git-scripts","f3rno64/mass-git-scripts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3rno64%2Fmass-git-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3rno64%2Fmass-git-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3rno64%2Fmass-git-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3rno64%2Fmass-git-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f3rno64","download_url":"https://codeload.github.com/f3rno64/mass-git-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254530303,"owners_count":22086584,"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":["bash","bash-script","git","git-utils","scripts","utilities"],"created_at":"2024-11-19T21:28:23.660Z","updated_at":"2025-05-16T12:31:58.243Z","avatar_url":"https://github.com/f3rno64.png","language":"Shell","readme":"# Scripts For Managing Many Git Repositories\n\n\u003e mass-git-scripts\n\n\u003cdiv style=\"width: 80%; margin: 0 auto;\"\u003e\n  \u003cimg src=\"./res/git_clone_all_example.png\" height=\"400\" alt=\"git-clone-all Example\"\u003e\u003c/img\u003e\n\u003c/div\u003e\n\nThis repo contains a few scripts for managing large numbers of git\nrepositories, either all those belonging to a user or organization on GitHub, or\nsimply all repositories in a direct:ory.\n\nThe inspiration for this was the need to back up all of my personal repositories\n(over 100) with full history and all branches. I thought it would make a good\nside project to write a script to do this.\n\n## Requirements\n\nA few programs are required to run these scripts:\n\n- [**jq**](https://stedolan.github.io/jq/): A lightweight and flexible\n  command-line JSON processor\n- [**parallel**](https://www.gnu.org/software/parallel/): A shell tool for\n  executing jobs in parallel using one or more computers\n- [**gh**](https://cli.github.com/): GitHub CLI\n\nYou should be able to install them with your local package manager, for example\non ubuntu:\n\n```bash\nsudo apt install jq parallel gh\n```\n\n## Installation\n\nTo use, clone this repository, and run `sudo make install` to install the\nscripts in `/usr/local/bin`.\n\nThen, for example, if you have your personal repos in `~/.src/github/username`,\nand want to update all of them, you can run:\n\n```bash\ngit-pull-all ~/.src/github/username\n```\n\nIf you have reset your environment and want to clone all of your repos, you can\nrun:\n\n```bash\ngit-clone-all --owner user --dir ~/.src/github/user --limit 1000 --jobs 20\n```\n\n## Usage\n\nThe examples below assume you have installed this repository, and the scripts\nwithin are available in your path.\n\n### git-clone-all\n\n\u003e Repositories that are already present in the target folder are skipped. The\n\u003e command output will report the number of **skipped** and **cloned**\n\u003e repositories.\n\nThe **`git-clone-all`** script clones all repositories belonging to a user or\norganization on GitHub, specified via the **--owner** flag.\n\nThe target directory in which the repositories will be cloned **must** be\nspecified and exist. Pass it via the **--dir** argument.\n\nYou can set the clone depth with **--depth**; by default, the\n**entire history** is cloned.\n\nTo limit the number of repositories cloned, pass the **--limit** flag. The\ndefault **--limit** flag value is **25**. If you wish to clone all repositories,\nconsider setting the limit to a very high value, like **--limit 1000**.\n\nThe script clones repositories in parallel, with the number of concurrent jobs\nspecified with the **--jobs** flag. The default number of jobs is\n**8**.\n\nSome examples:\n\n```bash\ngit-clone-all --owner f3rno64 --dir ./f3rno64 --limit 200 --jobs 20\ngit-clone-all --owner google --dir ./google --limit 10000 --jobs 50 --depth 1\ngit-clone-all --owner microsoft --dir ./microsoft\n```\n\n### git-pull-all\n\n\u003e The command output will report the number of new commits pulled if there are\n\u003e any.\n\nWhen you have many repositories in a single directory, and they are frequently\nupdated, **git-pull-all** can be used to update the active branch for each repo\nwith the latest changes from the active remote.\n\nThis is very useful if you keep all repositories for an organization (such as your\nemployer) in a single directory.\n\nTo use, just pass the directory containing the repositories as the first\nargument to the script:\n\n```bash\ngit-pull-all ~/.src/github/f3rno64\n```\n\n## Developing\n\nTo contribute, clone this repo and hack away! There is only one useful script\nin the manifest, **`lint`**, which uses **shellcheck** and **markdownlint** to\nlint the scripts and README.\n\nRun it to ensure your changes are up to standard. It is also run as a\npre-commit hook.\n\nMake sure to install dependencies for development with `pnpm i`.\n\n## Conclusion\n\n**mass-git-scripts** is a set of useful tools for anyone working with many git\nrepositories organized in separate folders by their owner (user or\norganization).\n\nGive it a try and see how it can improve your workflow.\n\n## License\n\nDistributed under the **MIT** license. See [**`LICENSE.md`**](./LICENSE.md)\nfor more information.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3rno64%2Fmass-git-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff3rno64%2Fmass-git-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3rno64%2Fmass-git-scripts/lists"}