{"id":16193752,"url":"https://github.com/chilijung/git-diff-tags","last_synced_at":"2026-04-28T12:02:11.193Z","repository":{"id":86704710,"uuid":"94993276","full_name":"chilijung/git-diff-tags","owner":"chilijung","description":"get diff files between git tags","archived":false,"fork":false,"pushed_at":"2018-03-03T14:37:32.000Z","size":42,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-01T01:03:45.198Z","etag":null,"topics":["git","git-diff","git-tags","js","node","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/chilijung.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":"2017-06-21T10:39:17.000Z","updated_at":"2018-03-05T04:37:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd08be47-8e2f-4511-9c8f-9ef9f48ee27a","html_url":"https://github.com/chilijung/git-diff-tags","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/chilijung/git-diff-tags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilijung%2Fgit-diff-tags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilijung%2Fgit-diff-tags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilijung%2Fgit-diff-tags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilijung%2Fgit-diff-tags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chilijung","download_url":"https://codeload.github.com/chilijung/git-diff-tags/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chilijung%2Fgit-diff-tags/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32379629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"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":["git","git-diff","git-tags","js","node","nodejs"],"created_at":"2024-10-10T08:16:28.865Z","updated_at":"2026-04-28T12:02:11.177Z","avatar_url":"https://github.com/chilijung.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-diff-tags\n\nUsing git diff to get change files between tags.\n\n## Why?\n\nIn our team [Canner](https://www.canner.io/) we encounter a big problem while publishing our assets (images, fonts, ...etc) to s3 server, each time with a new release we need to upload all our assets to s3. Before this package we don't know what files are already uploaded, so we uploaded all the files each time we're going to deploy.\n\nIn order to solve it, we develop `git-diff-tags` to find out which files are modified, created, deleted ...etc, between each tags and upload needed files and folders.\n\n`git-diff-tags` let you find out what files are modified, created, deleted between tags with ease. Hope this also help in your projects. :)\n\n## Install\n\n```\nnpm install git-diff-tags\n```\n\n## Usage\n\n```js\nimport GitDiffTags from \"../src/index\";\n\nconst diff = new GitDiffTags(\"./\", \"v0.2.0\", \"v0.2.0-a\");\n// can also diff to HEAD commit\n// const diff = new GitDiffTags(\"./\", \"v0.2.0\");\n// diff last tag to HEAD commit\n// const diff = new GitDiffTags(\"./\");\n\n\nexport interface IFileStatus {\n  path: string;\n\n  // refs: https://git-scm.com/docs/git-diff\n  // A: addition of a file\n  // C: copy of a file into a new one\n  // D: deletion of a file\n  // M: modification of the contents or mode of a file\n  // R: renaming of a file\n  // T: change in the type of the file\n  // U: file is unmerged (you must complete the merge before it can be committed)\n  // X: \"unknown\" change type (most probably a bug, please report it)\n  status: StatusTypes;\n}\n\n\ndiff.start()\n      .then((result: IFileStatus[]) =\u003e {\n        // the diffs between v0.2.0 and v0.2.0-a\n        // result is an IFileStatus[]\n      })\n      .catch((err) =\u003e {\n        throw(new Error(err));\n      });\n```\n\n## API\n\n### GitDiffTags(dirPath: string, tagFrom: string?, tagTo: string?)\n\ncreate a reference. If `tagTo` is null diff from `tagFrom` to `HEAD`. if `tagFrom` is null set to last tag.\n\n### diffTag.start(): Promise\u003cIFileStatus[]\u003e\n\nreturn a ConvenientPath array, see http://www.nodegit.org/api/convenient_patch.\n\n## Demo usage in gulp\n\nIn our team, we use this package with gulpjs. To upload only the modified and added files to server\n\nexample:\n\n```js\nconst gulp = require('gulp');\nconst path = require('path');\nconst imagemin = require('gulp-imagemin');\nconst rimraf = require('rimraf');\nconst GitDiffTags = require('git-diff-tags').default;\n\ngulp.task('image', function() {\n  rimraf.sync(path.resolve('./public/images_dist'));\n  const diff = new GitDiffTags('./');\n\n  return diff.start()\n      .then(result =\u003e {\n        // find out what assets are modified or added since last tag.\n        let addedFiles = [];\n        result.forEach(patch =\u003e {\n          const filePath = patch.path;\n          if ((patch.status === 'A' || patch.status === 'M') \u0026\u0026 filePath.match(/^public\\/image.*(\\.png|\\.gif)$/g))\n            addedFiles.push(filePath);\n        });\n\n        return gulp.src(addedFiles, {base: \"public/images\"})\n          .pipe(imagemin({verbose: true}))\n          .pipe(gulp.dest('./public/images_dist'));\n      })\n      .catch(err =\u003e {\n        throw (new Error(err));\n      });\n});\n\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchilijung%2Fgit-diff-tags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchilijung%2Fgit-diff-tags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchilijung%2Fgit-diff-tags/lists"}