{"id":17961758,"url":"https://github.com/vittorioromeo/git-ws","last_synced_at":"2025-09-10T00:41:22.078Z","repository":{"id":8967004,"uuid":"10708357","full_name":"vittorioromeo/git-ws","owner":"vittorioromeo","description":"C++14 command line utility (git plugin) to work with multiple git repositories at once","archived":false,"fork":false,"pushed_at":"2019-09-02T11:01:35.000Z","size":263,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T02:21:37.732Z","etag":null,"topics":["application","c-plus-plus","cpp","cpp11","cpp14","git","git-ws","subshell","utility"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vittorioromeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-15T15:52:02.000Z","updated_at":"2021-04-02T05:08:08.000Z","dependencies_parsed_at":"2022-09-18T15:12:12.951Z","dependency_job_id":null,"html_url":"https://github.com/vittorioromeo/git-ws","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vittorioromeo/git-ws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2Fgit-ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2Fgit-ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2Fgit-ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2Fgit-ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vittorioromeo","download_url":"https://codeload.github.com/vittorioromeo/git-ws/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2Fgit-ws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274390681,"owners_count":25276408,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["application","c-plus-plus","cpp","cpp11","cpp14","git","git-ws","subshell","utility"],"created_at":"2024-10-29T11:11:14.219Z","updated_at":"2025-09-10T00:41:22.063Z","avatar_url":"https://github.com/vittorioromeo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-ws\n\nCommand line utility to work with multiple git repositories at once \u003cbr/\u003e\nCurrently intended for personal use only, but quite functional\n\n\n## How to build\n\nTested on: **Arch Linux**, with **g++ 4.7.2** and **g++ 4.8.1**\n\n1. Clone this repo\n```bash\ngit clone https://github.com/SuperV1234/git-ws\n```\n\n2. Pull all submodules recursively\n```bash\ncd git-ws\n./init-repository.sh\n```\n\n3. Build all submodules + `git-ws`\n```bash\n./build-repository-git-ws.sh\n```\n\n4. You may have to append `/usr/local/lib` to the `$PATH` or `$LD_LIBRARY_PATH` environment variables to allow git-ws to find the required libraries - if that doesn't work, try:\n```bash\nsudo ldconfig /usr/local/lib  \n```\n\n5. Use `git-ws`!\n\n\n## Usage\n\nUsing `git-ws` in a directory calls git commands in all subdirectiories which are git repositories.\n\nAuto generated help\n```bash\n\u003c? || help\u003e  (OPTARG Command name) [-v || --verbose] \n\n\u003e\u003eShow help for all commands or a single command.\n\n\tOptional arguments:\n* (OPTARG Command name)\n  --Command name\n  --Name of the command to get help for.\n  --Leave blank to get general help.\n\n\n\tFlags:\n* [-v || --verbose]\n  --Verbose general help?\n\n\n\n\u003cpush\u003e   [-f || --force] [-a || --all] \n\n\u003e\u003ePushes every git repo.\n\n\tFlags:\n* [-f || --force]\n  --Forced push?\n\n* [-a || --all]\n  --Run the command in all repos (even non-ahead ones), for all branches.\n\n\n\n\u003cpull\u003e   [-s || --stash] [-f || --force-checkout] [-c || --changed-only] \n\n\u003e\u003ePulls every git repo.\n\n\tFlags:\n* [-s || --stash]\n  --Stash all changes before pulling?\n\n* [-f || --force-checkout]\n  --Run a force checkout before pulling?\n\n* [-c || --changed-only]\n  --Run the command only in folders where repos have changes?\n\n\n\n\u003csub || submodule\u003e (ARG Action)  [-c || --changed-only] \n\n\u003e\u003eWork with git submodules in every repo.\n\n\tRequired arguments:\n* (ARG Action)\n  --Action\n  --Action to run for every submodule. Can be 'push', 'pull' or 'au'.\n  --'push' commits all changes in the repo and pushes them to the remote. Do not run this unless all non-submodule changes have been taken care of!\n'pull' recursively pulls the latest submodules from the remote.\n'au' calls 'pull' then 'push' in succession.\n\n\n\tFlags:\n* [-c || --changed-only]\n  --Run the command only in folders where repos have changes?\n\n\n\n\u003cst || status\u003e   [-a || --showall] \n\n\u003e\u003ePrints the status of all repos.\n\n\tFlags:\n* [-a || --showall]\n  --Print empty messages?\n\n\n\n\u003cgitg\u003e   [-c || --changed-only] \n\n\u003e\u003eOpen the gitg gui application in every repo folder.\n\n\tFlags:\n* [-c || --changed-only]\n  --Open gitg only in folders where repos have changes?\n\n\n\n\u003cdo\u003e (ARG Command to run)  [-c || --changed-only] [-a || --ahead-only] \n\n\u003e\u003eRuns a shell command in every repo folder.\n\n\tRequired arguments:\n* (ARG Command to run)\n  --Command to run\n  --This is the command that will be called in every repo folder.\n  --Consider wrapping a more complex command with quotes.\n\n\n\tFlags:\n* [-c || --changed-only]\n  --Run the command only in folders where repos have changes?\n\n* [-a || --ahead-only]\n  --Run the command only in folders where repos are ahead of the remote?\n\n\n\n\u003cquery\u003e    \n\n\u003e\u003eQueries the status of all the repos, returning whether they are changed or ahead.\n\n\n```\n\n* `git-ws ?`: displays auto-generated help for all commands\n* `git-ws ? (command name)`: displays auto-generated help for a command\n* `git-ws query`: displays all repos detected by git-ws\n* `git-ws push`: push staged changes\n* `git-ws push -f`: force push staged changes\n* `git-ws push -a`: push staged changes, only in repos ahead from remote\n* `git-ws pull`: pull latest version\n* `git-ws pull -s`: pull latest version, stashing all changes before pulling\n* `git-ws status` or `git-ws st`: displays short git status, ignoring dirty submodules\n* `git-ws submodule push` or `git-ws sub push`: commits all staged changes and pushes (intended to be used only after non-submodule changes have been pushed)\n* `git-ws sub pull`: stashes all submodule local changes, pulls latest submodules recursively\n* `git-ws sub au`: equivalent of `git-ws submodule pull` followed by `git-ws submodule push` and by `git submodule update`\n* `git-ws do 'command here'`: creates a subshell in every git repo folder, and executes a bash command in it\n* `git-ws do -c 'command here'`: creates a subshell in every git repo folder with changes, and executes a bash command in it\n* `git-ws do -a 'command here'`: creates a subshell in every ahead git repo folder, and executes a bash command in it\n\n\n\n## Why is this useful?\n\nReal-life situation: I'm working on Open Hexagon and related libraries. \u003cbr/\u003e\nI create a `OHWorkspace` folder, where I clone all the required git repos.\n\n* `mkdir OHWorkspace; cd OHWorkspace`\n* `git clone http://.../SSVUtils`\n* `git clone http://.../SSVUtilsJson`\n* `git clone http://.../SSVStart`\n* `git clone http://.../\u003cetc\u003e`\n* `git clone http://.../SSVOpenHexagon`\n\nNow my directory tree looks like this:\n\n```\nOHWorkspace/\n\t...\n\tSSVUtils/\n\t\t.git/\n\t\t...\n\tSSVUtilsJson/\n\t\t.git/\n\t\t...\n\tSSVStart/\n\t\t.git/\n\t\t...\n\tSSVOpenHexagon/\n\t\t.git/\n\t\t...\n```\n\nI work on all the repos simultaneously. I constantly need to check what repos I've modified.\n\n* `cd OHWorkspace/; git-ws st` (st == status)\n* returns a human-readable list of changes\n\nAfter I review changes, it's time to commit.\n\n* `git-ws gitg -c` or `git-ws do \"open your favorite GUI here\"` (this opens gitg in every repo with changes to commit) \n\nI use gitg to make my commits.\n\n* `git-ws push -a; git-ws sub au` (these two commands save a lot of time: first, all staged commits in ahead repos are pushed to GitHub - then, every submodule is recursively pulled, updated, and pushed, so that the online submodules are up-to-date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvittorioromeo%2Fgit-ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvittorioromeo%2Fgit-ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvittorioromeo%2Fgit-ws/lists"}