{"id":15552225,"url":"https://github.com/bahmutov/git-last","last_synced_at":"2025-06-28T23:01:39.583Z","repository":{"id":23254022,"uuid":"98545397","full_name":"bahmutov/git-last","owner":"bahmutov","description":"Shows last git commit SHA or/and saves it in a JSON file","archived":false,"fork":false,"pushed_at":"2025-06-28T03:59:14.000Z","size":354,"stargazers_count":4,"open_issues_count":14,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-28T04:31:15.974Z","etag":null,"topics":["build","commit","git","save","sha","util"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bahmutov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2017-07-27T14:26:20.000Z","updated_at":"2023-09-08T17:27:58.000Z","dependencies_parsed_at":"2023-12-05T04:23:54.997Z","dependency_job_id":"5b31092d-6d92-4665-ab4d-6d8797c82262","html_url":"https://github.com/bahmutov/git-last","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/bahmutov/git-last","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fgit-last","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fgit-last/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fgit-last/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fgit-last/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/git-last/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fgit-last/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262376250,"owners_count":23301345,"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":["build","commit","git","save","sha","util"],"created_at":"2024-10-02T14:12:57.413Z","updated_at":"2025-06-28T23:01:39.493Z","avatar_url":"https://github.com/bahmutov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-last\n\n\u003e Shows last git commit SHA or/and saves it in a JSON file\n\n[![NPM][npm-icon] ][npm-url]\n\n[![Build status][ci-image] ][ci-url]\n[![semantic-release][semantic-image] ][semantic-url]\n[![js-standard-style][standard-image]][standard-url]\n[![renovate-app badge][renovate-badge]][renovate-app]\n\n## Install\n\nRequires [Node](https://nodejs.org/en/) version 6 or above.\n\n```sh\nnpm install --save git-last\n```\n\n## Use\n\nCall from CLI to either show or save commit id into a file\n\n```bash\n$(npm bin)/git-last -f build.json\nsaved last commit d9a0dc152... (short d9a0dc1) in file build.json\nlast commit: d9a0dc152...\ncat build.json\n{\n  \"id\": \"d9a0dc15206396663e7c8f29aea07be8534c2ae4\",\n  \"short\": \"d9a0dc1\",\n  \"savedAt\": \"2017-07-27T14:37:06.850Z\",\n  \"version\": \"0.0.0-development\"\n}\n```\n\nIf available, will load `package.json` and will save its version in the output\nfile as well\n\nFor my convenience there is also same timestamp but in Eastern Time Zone.\n\nIf you pass `-m` or `--message` option, the saved file will have commit's abbreviated\nmessage (like first 15 characters). This makes finding the deployed commit much faster.\n\n## Related\n\n* [ggit](https://github.com/bahmutov/ggit#readme) - Node API to Git commands\n\n### Small print\n\nAuthor: Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt; \u0026copy; 2017\n\n* [@bahmutov](https://twitter.com/bahmutov)\n* [glebbahmutov.com](https://glebbahmutov.com)\n* [blog](https://glebbahmutov.com/blog)\n\nLicense: MIT - do anything with the code, but don't blame me if it does not work.\n\nSupport: if you find any problems with this module, email / tweet /\n[open issue](https://github.com/bahmutov/git-last/issues) on Github\n\n## MIT License\n\nCopyright (c) 2017 Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n[npm-icon]: https://nodei.co/npm/git-last.svg?downloads=true\n[npm-url]: https://npmjs.org/package/git-last\n[ci-image]: https://travis-ci.org/bahmutov/git-last.svg?branch=master\n[ci-url]: https://travis-ci.org/bahmutov/git-last\n[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-url]: https://github.com/semantic-release/semantic-release\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n[standard-url]: http://standardjs.com/\n[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg\n[renovate-app]: https://renovateapp.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fgit-last","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Fgit-last","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fgit-last/lists"}