{"id":25969481,"url":"https://github.com/d4rkr00t/get-changed-files","last_synced_at":"2026-05-15T18:34:44.080Z","repository":{"id":145490567,"uuid":"115116139","full_name":"d4rkr00t/get-changed-files","owner":"d4rkr00t","description":"Get a list of changed files","archived":false,"fork":false,"pushed_at":"2017-12-26T11:20:58.000Z","size":135,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T09:29:41.504Z","etag":null,"topics":["changes","diff","git"],"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/d4rkr00t.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-12-22T13:07:14.000Z","updated_at":"2022-07-04T02:21:34.000Z","dependencies_parsed_at":"2023-04-17T11:39:18.455Z","dependency_job_id":null,"html_url":"https://github.com/d4rkr00t/get-changed-files","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/d4rkr00t/get-changed-files","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rkr00t%2Fget-changed-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rkr00t%2Fget-changed-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rkr00t%2Fget-changed-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rkr00t%2Fget-changed-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d4rkr00t","download_url":"https://codeload.github.com/d4rkr00t/get-changed-files/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rkr00t%2Fget-changed-files/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["changes","diff","git"],"created_at":"2025-03-04T22:48:15.451Z","updated_at":"2026-05-15T18:34:44.075Z","avatar_url":"https://github.com/d4rkr00t.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Get Changed Files\n\n\u003e Get a list of changed files using git.\n\n## Install\n\n```sh\nnpm intall get-changed-files --save-dev\nyarn add get-changed-files --dev\n```\n\n## API\n\n### Simple usage\n\nWithout any options `get-changed-files` assumes that `master` is the main branch to compare it against current branch and also uses [default strategy](https://github.com/d4rkr00t/get-changed-files/blob/15125b8aa6a128547ddca7edbb1eebde3f62541e/git.js#L18-L25) for determining diff point (point in history from which to start getting changes).\n\n```js\nconst getChangedFiles = require(\"get-changed-files\");\ngetChangedFiles().then(results =\u003e console.log(results));\n\n/**\n * Outputs:\n * {\n *   \"changed\": [\n *     \"some-old-changed-file.js\",\n *     \"package.json\",\n *     \"new-file.js\"\n *   ],\n *   \"uncommitted\": [\n *     \"package.json\"\n *   ],\n *   \"untracked\": [\n *     \"new-file.js\"\n *   ]\n * }\n */\n```\n\n### Changing main branch\n\n```js\nconst getChangedFiles = require(\"get-changed-files\");\ngetChangedFiles({ mainBranch: \"develop\" }).then(results =\u003e\n  console.log(results)\n);\n```\n\n### Custom get diff point strategy\n\n```js\nconst getChangedFiles = require(\"get-changed-files\");\nconst customGetDiffPoint = ({ currentBranch, mainBranch }) =\u003e {\n  // do some magic...\n  return { commit: commit_hash_from_which_to_start_getting_changes };\n};\ngetChangedFiles({ customGetDiffPoint }).then(results =\u003e console.log(results));\n```\n\n## CLI\n\nAlso `get-changed-files` adds a CLI tool `get-changed`.\n\n```sh\nget-changed --help\n\n  Get a list of changed files\n\n  Usage\n    $ get-changed\n\n  Options\n    --branch, -b     Specify main branch [default: master].\n    --only, -o       Specify subset of results to be printed e.g. – changed | uncommitted | untracked.\n    --names          Output file names only without any formatting. Can't be used with --json.\n    --json           Output result as json. Can't be used with --names-only.\n\n  Examples\n    $ get-changed --only=changed\n    $ get-changed --json --only=changed\n    $ get-changed --names-only\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4rkr00t%2Fget-changed-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd4rkr00t%2Fget-changed-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4rkr00t%2Fget-changed-files/lists"}