{"id":41788987,"url":"https://github.com/da-x/git-search-replace","last_synced_at":"2026-01-25T04:33:43.939Z","repository":{"id":18545166,"uuid":"21746302","full_name":"da-x/git-search-replace","owner":"da-x","description":"A utility on top of Git for project-wide search-and-replace that includes filenames too","archived":false,"fork":false,"pushed_at":"2022-08-02T11:38:00.000Z","size":34,"stargazers_count":50,"open_issues_count":6,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-02T20:43:29.458Z","etag":null,"topics":["cli","git","python","regex"],"latest_commit_sha":null,"homepage":"","language":"Python","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/da-x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-11T18:08:57.000Z","updated_at":"2025-07-03T20:32:24.000Z","dependencies_parsed_at":"2022-08-07T09:00:47.135Z","dependency_job_id":null,"html_url":"https://github.com/da-x/git-search-replace","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/da-x/git-search-replace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/da-x%2Fgit-search-replace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/da-x%2Fgit-search-replace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/da-x%2Fgit-search-replace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/da-x%2Fgit-search-replace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/da-x","download_url":"https://codeload.github.com/da-x/git-search-replace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/da-x%2Fgit-search-replace/sbom","scorecard":{"id":316029,"data":{"date":"2025-08-11","repo":{"name":"github.com/da-x/git-search-replace","commit":"48ebd20af3bb9a1f20da8a1e08084456631c6dd2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 7/27 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T00:12:06.308Z","repository_id":18545166,"created_at":"2025-08-18T00:12:06.308Z","updated_at":"2025-08-18T00:12:06.308Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28743519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T02:46:29.005Z","status":"ssl_error","status_checked_at":"2026-01-25T02:44:29.968Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["cli","git","python","regex"],"created_at":"2026-01-25T04:33:43.863Z","updated_at":"2026-01-25T04:33:43.929Z","avatar_url":"https://github.com/da-x.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\n*git-search-replace* is a small utility on top of plain `git` for performing project-wide search-and-replace only on git-controlled files. It applies its searches to filenames as well as their content. The underlying syntax for the search regex is Python's.\n\nIt is designed to be a bit more instructive to the developer, compared to hackish `bash` scripts around `sed`.\n\nAn accompanying utility is *gsr-branch*, which does the same thing as *git-search-replace* but on the *history of a branch* (using `git filter-branch`). It's especially useful for fixing a whole bunch of commits at once when the fix is a simple search \u0026 replace (retaining a clean history).\n\nKey features are:\n\n* By default, only act as grep to show what is going to change.\n* Dry run mode (`--diff`) shows a unidiff of the changes that the search-and-replace would do, so that the developer can review for correctness. No working directory files are modified.\n* Fix mode (`--fix`) performs the actual changes and associated 'git mv'.\n\n### Wait, but my awesome editor can already do that!\n\nThat's right, but when you are working within a group of people and everyone has their own editor, it becomes quite useful to be able to communicate renames in a way that everyone can easily reproduce, and during conflict resolution it is even more useful (see: [git-mediate](https://github.com/Peaker/git-mediate)). This comes handy especially in commit message, for instance:\n\n```\n    commit 3ed68e243e76783fa2b92fa33f7e4681f0246332\n    Author: Dan Aloni \u003calonid@gmail.com\u003e\n    Date:   Sun Jul 26 18:42:52 2015 +0300\n\n    module: renamed with: gsr foo///bar -f\n\n```\n\n# Syntax\n\n```\nUsage: gsr [options] (FROM-SEPARATOR-TO...)\n       gsr [options] -p FROM1 TO1  FROM2 TO2 ...\n\nOptions:\n  -h, --help            show this help message and exit\n  -s STRING, --separator=STRING\n                        The separator string the separates FROM and TO\n                        regexes. /// by default, if -p is not specified\n  -p, --pair-arguments  Use argument pairs for FROM and TO regexes. Useful with\n                        shell expansion. E.g: colo{,u}r\n  -f, --fix             Perform changes in-place\n  -d, --diff            Use 'diff' util to show differences\n  -e PATTERN, --exclude=PATTERN\n                        Exclude files matching the provided globbing pattern\n                        (can be specified more than once)\n  -i PATTERN, --include=PATTERN\n                        Include files matching the provided globbing pattern\n                        (can be specified more than once)\n  --no-renames          Don't perform renames\n```\n\nThe expressions are tuples in the form of FROM-SEPARATOR-TO, with SEPARATOR defaults to '///'.\n\nThe `-e` and `-i` options abide by the following rules:\n\n* Each of these can be passed multiple times.\n* The order matters, as they are checked in that order for each file. Last matcher takes effect when matched.\n* If neither is passed, all files are included by default.\n* If `-i` if given first, then by default all files are excluded.\n\n# Examples\n\nShell escaping needs to be taken into consideration. The examples below should work with the major UNIX shells.\n\n    gsr old_name///new_name --diff\n\nThis shows a diff that represents the replacement of 'old_name' with 'new_name'.\n\n    gsr \\\\bold_name\\\\b///new_name --fix\n\nThis uses Python regex expression \\b for matching at word boundaries for whole identifiers. This invocation will perform changes in-place because of '--fix'.\n\n    gsr 'things with space///with other stuff' --diff\n\nNote that shells properly de-escape the quotes from the expression above.\n\nExample of using *gsr-branch*:\n\n    gsr-branch.py HEAD~10 '(\\.|\\-\\\u003e)ol_header///\\1header'\n\nRuns the search replace regex over the last 10 commits, modifying them in-place. The regex will replace the string `.ol_header` (or `-\u003eol_header`) with `.header` (or `-\u003eheader`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fda-x%2Fgit-search-replace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fda-x%2Fgit-search-replace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fda-x%2Fgit-search-replace/lists"}