{"id":15408911,"url":"https://github.com/antongolub/git-glob-cp","last_synced_at":"2025-07-28T11:03:42.020Z","repository":{"id":50313541,"uuid":"503683788","full_name":"antongolub/git-glob-cp","owner":"antongolub","description":"Glob-aware two-way copying for git","archived":false,"fork":false,"pushed_at":"2023-11-12T12:02:15.000Z","size":6463,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-09T15:10:46.208Z","etag":null,"topics":["git","glob","util"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/antongolub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2022-06-15T08:40:51.000Z","updated_at":"2023-05-20T06:20:32.000Z","dependencies_parsed_at":"2022-09-24T11:52:44.333Z","dependency_job_id":"a9710cd1-9252-44c8-a5f6-14380da5f099","html_url":"https://github.com/antongolub/git-glob-cp","commit_stats":{"total_commits":91,"total_committers":5,"mean_commits":18.2,"dds":0.3296703296703297,"last_synced_commit":"123577520d97d51e71145dfae60d279d184594e8"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/antongolub/git-glob-cp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antongolub%2Fgit-glob-cp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antongolub%2Fgit-glob-cp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antongolub%2Fgit-glob-cp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antongolub%2Fgit-glob-cp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antongolub","download_url":"https://codeload.github.com/antongolub/git-glob-cp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antongolub%2Fgit-glob-cp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267505099,"owners_count":24098346,"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-07-28T02:00:09.689Z","response_time":68,"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":["git","glob","util"],"created_at":"2024-10-01T16:35:51.146Z","updated_at":"2025-07-28T11:03:42.000Z","avatar_url":"https://github.com/antongolub.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ggcp\n\n\u003e git-glob-copy — glob-aware two-way copying for git\n\n[![Release](https://github.com/antongolub/git-glob-cp/workflows/CI/badge.svg)](https://github.com/antongolub/git-glob-cp/actions)\n[![Maintainability](https://api.codeclimate.com/v1/badges/2995a0e9d2a84bd4191f/maintainability)](https://codeclimate.com/github/antongolub/git-glob-cp/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/2995a0e9d2a84bd4191f/test_coverage)](https://codeclimate.com/github/antongolub/git-glob-cp/test_coverage)\n\n## Requirements\n* Node.js \u003e= 16\n\n## Install\n```shell\nnpm i git-glob-cp\n\n# or as a global package\nnpm i -g ggcp\n```\n\n## Usage\nTo perform various repos automations: bulk config reading, cascade template updating, etc.\n\n### CLI\n```shell\n# Copy `json` files from `master` branch of remote repo to local dir `temp`\ngit-glob-copy git@github.com:antongolub/tsc-esm-fix.git/master/*.json temp\n\n\n# Push `json` files from local `.` dir to remote `json` branch\ngit-glob-copy *.json git@github.com:antongolub/tsc-esm-fix.git/master/json\n\n\n# Push from repo to repo\nggcp 'git@github.com:antongolub/tsc-esm-fix.git/master/foo/*.txt' git@github.com:antongolub/git-glob-copy.git/master/bar\n\n\n# Fetch remote archive to local dir\nggcp 'https://registry.npmjs.org/ggcp/-/ggcp-1.5.1.tgz/**/*.js' /private/tmp/ggcp-1.5.1/\n```\n`ggcp` is an alias for `git-glob-copy`\n\n| Flag                | Description                                        | Default         |\n|---------------------|----------------------------------------------------|-----------------|\n| `--message -m`      | Commit message                                     | `chore: sync`   |\n| `--version -v`      | Print version                                      |                 |\n| `--help -h`         | Show help                                          |                 |\n| `--ignore-files -i` | Path to ignoreFile (like .gitignore or .npmignore) |                 |\n| `--cwd -C`          | Working directory                                  | `process.cwd()` |\n\n### Pattern examples\n```js\n// Absolute dir path\n'/foo/bar'\n\n// Rel paths\n'./foo/bar'\n'foo/bar'\n\n// Any depth md-filter\n'./**/*.md'\n\n// git://, git@, ssh://, https:// refs\n'https://github.com/antongolub/tsc-esm-fix.git/master/*.json'\n'ssh://github.com/antongolub/git-glob-cp.git/test/test'\n'git@github.com:antongolub/git-glob-cp.git/master/foo/bar/**/*.js'\n'git://github.com/antongolub/git-glob-cp.git/some-branch-name/test/**/*.js'\n// repo ref                                 // branch        // glob pattern\n\n'https://registry.npmjs.org/ggcp/-/ggcp-1.5.1.tgz/**/*.js'\n// archive ref                                   // glob pattern\n```\n\n### JS API\n```js\nimport { copy } from 'ggcp'\n\nconst from = 'git@github.com:antongolub/tsc-esm-fix.git/master/*.json'\nconst to = 'temp'\nconst msg = 'updated'\nconst ignoreFiles = '.gitignore'\n\n// Copy any to any\nawait copy(from, to, msg, ignoreFiles)\nawait copy({from, to, msg, ignoreFiles}) // opts-based syntax\n\n// Synchronizes dirs only\nawait copydir({\n  from,       // Relative dir / glob pattern(s)\n  baseFrom,   // Base dir. Defaults to process.cwd()\n  to,         // Rel path.\n  baseTo,     // Base dir. Defaults to process.cwd()\n  debug,      // Debugger. Defauts to noop\n  ignoreFiles // Glob patterns to look for ignore files. string | string[]\n})\n```\n\n### GitHub Actions\nFor example, push `lcov.info` from the `coverage` dir into the `/\u003ccommit-sha\u003e` dir of the `coverage` branch of the remote repo.\n\n```yaml\n  - name: Store coverage\n    run: |\n      npm_config_yes=true npx ggcp lcov.info https://${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git/coverage/${{ github.sha }} --cwd=${{ github.workspace }}/coverage --message='chore: push coverage'\n```\n\n## References\n* [antongolub/globby-cp](https://github.com/antongolub/globby-cp)\n* [abelnation/globcp](https://github.com/abelnation/globcp#readme)\n* [ufologist/copy-push](https://github.com/ufologist/copy-push#readme)\n* [npm/git](https://github.com/npm/git)\n\n## License\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantongolub%2Fgit-glob-cp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantongolub%2Fgit-glob-cp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantongolub%2Fgit-glob-cp/lists"}