{"id":21832685,"url":"https://github.com/tool3/restory","last_synced_at":"2026-05-06T23:39:52.420Z","repository":{"id":102712757,"uuid":"331956250","full_name":"tool3/restory","owner":"tool3","description":"📖 rewrite git history","archived":false,"fork":false,"pushed_at":"2025-03-18T09:42:23.000Z","size":942,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T10:32:04.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://restory.netlify.app","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/tool3.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":"2021-01-22T13:36:24.000Z","updated_at":"2021-10-03T06:57:02.000Z","dependencies_parsed_at":"2023-11-01T21:30:41.981Z","dependency_job_id":null,"html_url":"https://github.com/tool3/restory","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tool3%2Frestory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tool3%2Frestory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tool3%2Frestory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tool3%2Frestory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tool3","download_url":"https://codeload.github.com/tool3/restory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244807278,"owners_count":20513607,"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":[],"created_at":"2024-11-27T19:24:57.253Z","updated_at":"2026-05-06T23:39:47.389Z","avatar_url":"https://github.com/tool3.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./shellfies/logo.png\" /\u003e\n\n# restory 2.0\n\n✅ Rewritten in TypeScript.  \n✅ Added quiet mode.  \n✅ super fast (uses git-filter-repo instead of git filter branch).  \n✅ simple and intuitive api.  \n✅ standalone - no 3rd party requirements (git-filter-repo included).\n\n\u003e [!CAUTION]\n\u003e THIS WILL REWRITE YOUR GIT HISTORY!  \n\u003e THIS OPERATION CANNOT BE REVERTED!  \n\u003e USE AT YOUR OWN RISK!\n\n# install\n\n```bash\nnpm install -g @tool3/restory\n```\n\nor\n\n```bash\nnpx @tool3/restory \u003ccmd\u003e [args] [options]\n```\n\nthings to know:\n\n- `restory` uses it's own dist of [`git-filter-repo`](https://github.com/newren/git-filter-repo)  \n  and therefore doesn't rely on you having it.\n- by default it does **NOT** remove `origin` when done rewriting. (unless run with `--safe`).\n- every `restory` command recreates the commit|s shas.\n- you need to have a clean working directory.\n- you will have to force push if using the same `origin`.\n- when run without commit filter flag (`-s` || `-n` || `-r` - see [options](#options)) - the command will rewrite **ALL** commits with given input.\n\n# api\n\nevery command in `restory` can either set a new value or replace an existing value.  \n`restory \u003ccmd\u003e [optional-subject-to-replace] \u003cvalue\u003e`  \nsee more details for each command [below](#commands)  \n| Command | Alias | Description |\n|----------|-------|-------------------------------------------------------------------------------------------------------|\n| `list` | `ls` | list all commits |\n| `redate` | `rd` | rewrite commit(s) date |\n| `reauthor`| `ra` | rewrite commit(s) author name |\n| `remail` | `re` | rewrite commit(s) author email |\n| `remsg` | `rm` | rewrite commit(s) message |\n| `rewrite`| `rw` | rewrite multiple commit fields. This command is a combination of all of the commands above, and is controlled with flags |\n\n# options\n\n| Option            | Alias | Description                                                                                                                                                 | Default         |\n| ----------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |\n| `sha`             | `s`   | rewrite a specific commit sha.                                                                                                                              |                 |\n| `quiet`           | `q`   | don't log every commit change.                                                                                                                              | `false`         |\n| `safe`            | `S`   | remove origin when done rewriting.                                                                                                                          | `false`         |\n| `range`           | `r`   | range of commits to operate on.                                                                                                                             |                 |\n| `ellipsis`        | `e`   | truncate output to minimum width.                                                                                                                           | `true`          |\n| `logo`            | `l`   | print logo.                                                                                                                                                 | `true`          |\n| `number`          | `n`   | number of commits.                                                                                                                                          | 0 (all commits) |\n| `committer`       | `c`   | include committer fields. For example: `author_date` will also include `committer_date` in the rewrite.                                                     | `true`          |\n| `git-filter-repo` | `g`   | use [`git filter-repo`](https://github.com/newren/git-filter-repo) instead of `git filter-branch`. This method is extremely fast compared to filter-branch. | `true`          |\n\n# commands\n\n## `ls`\n\nlist all commits\n\n```bash\nrestory ls\n```\n\n\u003cimg src=\"./shellfies/ls.png\" /\u003e\n\n[![](https://img.shields.io/static/v1?label=created%20with%20shellfie\u0026message=📸\u0026color=pink)](https://github.com/tool3/shellfie)\n\nlist last 5 commits\n\n```bash\nrestory ls -n 5\n```\n\nlist range of commits\n\n```bash\nrestory ls -r 'c884ca6' '0b4be21'\n```\n\n## `redate`\n\nrewrite all commits that has `2021` to year to `1984`\n\n```bash\nrestory redate 2021 1984\n```\n\nrewrites a specific commit's day\n\n```bash\nrestory redate 'Jan 23' 'Jan 24' -s '0b4be21'\n```\n\nrewrites the last 5 commits date to now\n\n```bash\nrestory redate \"$(echo `date`)\" -n 5\n```\n\n## `reauthor`\n\nrewrite all commit author names to `The Devil`\n\n\u003e [!CAUTION]\n\u003e IMPERSONATION IS STRICTLY PROHIBITED!  \n\u003e ANY IMPERSONATION WILL BE YOUR RESPONSIBILITY!\n\n```bash\nrestory reauthor 'The Devil'\n```\n\nrewrite last 5 commits author to `Jebediah Kerman`\n\n```bash\nrestory reauthor 'Jebediah Kerman' -n 5\n```\n\n## `remail`\n\nrewrite all commit author and committer email to `thedevil@666.com`\n\n\u003e [!CAUTION]\n\u003e IMPERSONATION IS STRICTLY PROHIBITED!  \n\u003e ANY IMPERSONATION WILL BE YOUR RESPONSIBILITY!\n\n```bash\nrestory remail 'thedevil@666.com'\n```\n\n## `remsg`\n\nrewrite specific commit message\n\n```bash\nrestory remsg 'this is the new commit msg' -s '620a83b'\n```\n\nrewrite `Moon` to `Mun` in all commit messages\n\n```bash\nrestory remsg 'Moon' 'Mun'\n```\n\n## `rewrite`\n\nrewrite commit message and replace date year `1987` to `1988` for the last 3 commits\n\n```bash\nrestory rewrite -m 'this is the new commit msg' -d '1987' '1988' -n 3\n```\n\nrewrite `Moon` to `Mun` in all commit messages\n\n```bash\nrestory rewrite -m 'Moon' 'Mun'\n```\n\nrewrite commit message, replace `t` to `z` in author name and set email to `new_value@world.com` in a range of commits\n\n```bash\nrestory rewrite -m 'new message' -a 't' 'z' -e 'new_value@world.com' -r '8381e6a' '4110655'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftool3%2Frestory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftool3%2Frestory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftool3%2Frestory/lists"}