{"id":20773480,"url":"https://github.com/jcfieldsdev/versions","last_synced_at":"2026-05-25T22:34:16.470Z","repository":{"id":211816879,"uuid":"730011524","full_name":"jcfieldsdev/versions","owner":"jcfieldsdev","description":"A command-line interface to the file versioning system of Mac OS","archived":false,"fork":false,"pushed_at":"2023-12-11T02:22:21.000Z","size":370,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T07:31:50.186Z","etag":null,"topics":["mac-os","objective-c","versioning"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcfieldsdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-12-11T02:13:37.000Z","updated_at":"2023-12-12T04:33:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"722c0344-4d9c-401a-b903-d0399fa4c39a","html_url":"https://github.com/jcfieldsdev/versions","commit_stats":null,"previous_names":["jcfieldsdev/versions"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcfieldsdev%2Fversions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcfieldsdev%2Fversions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcfieldsdev%2Fversions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcfieldsdev%2Fversions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcfieldsdev","download_url":"https://codeload.github.com/jcfieldsdev/versions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243112189,"owners_count":20238181,"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":["mac-os","objective-c","versioning"],"created_at":"2024-11-17T12:25:56.623Z","updated_at":"2025-12-24T22:40:09.813Z","avatar_url":"https://github.com/jcfieldsdev.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# versions\n\nA command-line utility for accessing the file versioning system of Mac OS. Written in Objective-C. Requires Mac OS 10.12 (Sierra) or higher.\n\n![Versions](screenshot.png)\n\nThe Versions feature was added in Lion, along with auto-saving, as part of a broad overhaul of the operating system's document model. It's similar to Time Machine in that it saves previous versions of files, but it works separately from it (and without it). This utility provides a way to view, restore, and delete old versions from the command line.\n\n## Releases\n\nBinary versions are available on the [Releases](https://github.com/jcfieldsdev/versions/releases) page.\n\nBinaries are self-signed but not notarized, so Mac OS 10.15 (Catalina) and higher display an error upon launching it. [Right-click the application icon and select \"Open\"](https://support.apple.com/guide/mac-help/open-an-app-by-overriding-security-settings-mh40617/mac) to enable the option to bypass this security warning.\n\n## Guide\n\nUsage: `versions [option] source_file [destination_file]`\n\nIf called with no option, lists all versions of the source file with identifiers.\n\nThe second argument for the destination file is only needed when using the `--restore` option.\n\n| Option | Flag | Function |\n| -- | -- | -- |\n| `--help` | `-h` | Shows list of options. |\n| `--view \u003cidentifier\u003e` | `-v \u003cid\u003e` | Views the previous version with the given identifier. |\n| `--restore \u003cidentifier\u003e` | `-r \u003cid\u003e` | Restores the previous version with the given identifier to a new file. Requires a second file argument for the destination file. |\n| `--replace \u003cidentifier\u003e` | `-p \u003cid\u003e` | Replaces the file with the previous version with the given identifier. |\n| `--delete \u003cidentifier\u003e` | `-d \u003cid\u003e` | Deletes the previous version with the given identifier. |\n| `--deleteAll` | `-x` | Deletes all previous versions of the file. |\n\nYou can use either the short flag or the long option version of each option (whichever you prefer). Only one option is accepted for a single command; any additional options are ignored.\n\nThe current version of the file always has the identifier 0 and cannot be used as an value for any of the options.\n\n## Examples\n\n### Listing previous versions\n\nTo look at all the previous versions of an example file \"columns.js\":\n\n    $ versions columns.js\n    [  2] Apr 7, 2020 at 10:29:48 PM     columns.js\n    [  1] Apr 7, 2020 at 10:35:22 PM     columns.js\n    [  0] Apr 7, 2020 at 10:49:09 PM     columns.js\n\nThe program prints a table of previous versions. For each version, it shows an identifier number, the date and time the version was saved, and the file name (which may have changed if the file was renamed). Identifier numbers count down, so 0 is always the most recent (current) version and larger numbers are older.\n\n### Viewing previous versions\n\nTo view a previous version, use the `--view` option:\n\n    $ versions --view 1 columns.js\n\nThis prints the contents of the file to the stdout stream, which you can view directly from the Terminal or combine with other Unix utilities. For example, you can pipe it into `less` for a scrollable view:\n\n    $ versions --view 1 columns.js | less\n\nOr open it as a temporary file in your default text editor:\n\n    $ versions --view 1 columns.js | open -ft\n\nOr copy its contents to the clipboard:\n\n    $ versions --view 1 columns.js | pbcopy\n\nOr combine it with `diff` to show the differences with the current version of the file:\n\n    $ versions --view 1 columns.js | diff columns.js -\n\n### Restoring previous versions\n\nIf we want to restore a previous version, we can use the `--restore` option to save it to a new file name:\n\n    $ versions --restore 1 columns.js columns-old.js\n    Successfully restored version 1 of columns.js to columns-old.js.\n\nThe provided number corresponds to the version we want to restore. If no number is provided, an error message is displayed. Restoring a file with this option doesn't change the version history of the original file. If there's already a file with the destination name, it will be overwritten.\n\nWe can also restore a previous version by replacing the latest version of the file (instead of saving it to another file). To do this, we use the `--replace` option:\n\n    $ versions --replace 1 columns.js\n    Successfully restored version 1 of columns.js.\n\nBecause we're replacing the original file, we don't need to provide a second file name. We do need to provide a version number or an error is displayed. Restoring a file with this option adds a new version to the history of the file but doesn't remove any of the previous versions.\n\n### Deleting previous versions\n\nDeleting versions works the same way. To delete a specific version, use the `--delete` option:\n\n    $ versions --delete 1 columns.js\n    Successfully deleted version 1 of columns.js.\n\nNote that deleting a version causes the other versions to be renumbered, so be careful issuing another command after a delete.\n\nTo delete all versions, use the `--deleteAll` option:\n\n    $ versions --deleteAll columns.js\n    Successfully deleted all previous versions of columns.js.\n\nBecause we're deleting all previous versions, we don't need to provide an identifier. The current version of the file will not be affected by this command. Make sure you really want to delete the file history since this command is irreversible.\n\n## Acknowledgments\n\nUses [GBCli](https://github.com/tomaz/GBCli) library by [Tomaz Kragelj](https://github.com/tomaz) for parsing command-line arguments.\n\nUses [replay icon](https://www.flaticon.com/free-icon/replay_1142347) by [Freepik](https://www.freepik.com/).\n\n## Authors\n\n- J.C. Fields \u003cjcfields@jcfields.dev\u003e\n\n## License\n\n- [GNU General Public License, version 3](https://opensource.org/licenses/GPL-3.0)\n\n## See also\n\n- [Restore](https://github.com/jcfieldsdev/restore)—A GUI application that does the same thing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcfieldsdev%2Fversions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcfieldsdev%2Fversions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcfieldsdev%2Fversions/lists"}