{"id":18576098,"url":"https://github.com/thiagodp/restage","last_synced_at":"2026-02-10T09:08:21.034Z","repository":{"id":200509430,"uuid":"705841374","full_name":"thiagodp/restage","owner":"thiagodp","description":"✅ Add only modified files to the staging area","archived":false,"fork":false,"pushed_at":"2024-06-07T23:19:13.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-16T17:10:20.964Z","etag":null,"topics":["area","captain-hook","git","husky","husky-php","lint","lint-staged","php","stage","staged","staging-area"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/thiagodp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-16T19:46:35.000Z","updated_at":"2024-06-07T23:19:13.000Z","dependencies_parsed_at":"2023-11-16T16:52:28.487Z","dependency_job_id":"f3eaca20-ccbe-4211-8d51-28c0d0db3e8c","html_url":"https://github.com/thiagodp/restage","commit_stats":null,"previous_names":["thiagodp/restage"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/thiagodp/restage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodp%2Frestage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodp%2Frestage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodp%2Frestage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodp%2Frestage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagodp","download_url":"https://codeload.github.com/thiagodp/restage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodp%2Frestage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29295486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T03:42:42.660Z","status":"ssl_error","status_checked_at":"2026-02-10T03:42:41.897Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["area","captain-hook","git","husky","husky-php","lint","lint-staged","php","stage","staged","staging-area"],"created_at":"2024-11-06T23:23:33.882Z","updated_at":"2026-02-10T09:08:20.976Z","avatar_url":"https://github.com/thiagodp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# restage\n\n\u003e ✅ Add only modified files to the staging area\n\n**Use case**: You're using Git and your files are ready to commit. But when you run `git commit`, your `pre-commit` Git Hook runs a formatting tool that changes your files again. Now you have to run `git add` again, but only for the changed files, since you don't want to add untracked files yet. _That's boring, I know_. Fortunately, now you can use `restage` for that.\n\n👉 `restage` adds only modified files to the staging area.\n\n_Note_: There are similar tools for JavaScript, such as [lint-staged](https://github.com/lint-staged/lint-staged), that can be used for this purpose. `restage` aims  at projects that do not need to use JavaScript.\n\n## Install\n\n\u003e Requires only PHP 7.0+ and Git\n\n```bash\ncomposer require phputil/restage --dev\n```\n\n## Usage\n\n```bash\nphp vendor/bin/restage\n```\n\nYou probably want to include the above command into your Git Hook (e.g. `pre-commit`), to be executed after a command that formats your source code. For instance, `php vendor/bin/php-cs-fixer \u0026\u0026 php vendor/bin/restage`.\n\n### CLI Options\n\n```txt\n  --help          This help.\n  --all,      -a  List untracked files and modified staged files.\n  --dry-run,  -d  Simulate the command without actually doing anything.\n  --modified, -m  List modified staged files.\n  --verbose,  -v  Enable verbose mode.\n```\n\n👉 If you wanna run a linter/formatter in modified files, you can use `--modified` to get them.\n\n### Useful tools\n\n- [Captain Hook](https://github.com/captainhookphp/captainhook) can manage your Git Hooks.\n- [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) can format your source code.\n- [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) is an alternative to PHP-CS-Fixer.\n\n## License\n\n[MIT](LICENSE) © [Thiago Delgado Pinto](https://github.com/thiagodp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagodp%2Frestage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagodp%2Frestage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagodp%2Frestage/lists"}