{"id":21667250,"url":"https://github.com/luftywiranda13/git-dir-up","last_synced_at":"2026-05-07T20:07:04.776Z","repository":{"id":57157332,"uuid":"117245933","full_name":"luftywiranda13/git-dir-up","owner":"luftywiranda13","description":"Find the closest `.git` directory","archived":false,"fork":false,"pushed_at":"2020-06-03T09:19:39.000Z","size":93,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T17:06:37.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/luftywiranda13.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}},"created_at":"2018-01-12T13:45:55.000Z","updated_at":"2018-03-29T14:21:47.000Z","dependencies_parsed_at":"2022-09-06T23:40:27.008Z","dependency_job_id":null,"html_url":"https://github.com/luftywiranda13/git-dir-up","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fgit-dir-up","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fgit-dir-up/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fgit-dir-up/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fgit-dir-up/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luftywiranda13","download_url":"https://codeload.github.com/luftywiranda13/git-dir-up/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244566931,"owners_count":20473451,"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-25T11:35:32.784Z","updated_at":"2026-05-07T20:07:04.746Z","avatar_url":"https://github.com/luftywiranda13.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-dir-up\n\n\u003e Find the closest `.git` directory\n\n[![Package Version](https://img.shields.io/npm/v/git-dir-up.svg?style=flat-square)](https://www.npmjs.com/package/git-dir-up)\n[![Downloads Status](https://img.shields.io/npm/dm/git-dir-up.svg?style=flat-square)](https://npm-stat.com/charts.html?package=git-dir-up\u0026from=2016-04-01)\n[![Build Status: Linux](https://img.shields.io/travis/luftywiranda13/git-dir-up/master.svg?style=flat-square)](https://travis-ci.org/luftywiranda13/git-dir-up)\n[![Coverage Status](https://img.shields.io/codecov/c/github/luftywiranda13/git-dir-up/master.svg?style=flat-square)](https://codecov.io/gh/luftywiranda13/git-dir-up)\n\nUseful for tools that need to know whether `git` is managing the things inside.\n\n## Installation\n\n```sh\nnpm install --save git-dir-up\n```\n\n## Usage\n\n```sh\n/\n└── Users\n    └── luftywiranda\n        └── foo\n            ├── .git\n            └── bar\n                ├── baz\n                └── example.js\n```\n\n```js\n// example.js\nconst gitDirUp = require('git-dir-up');\n\ngitDirUp(__dirname).then(filepath =\u003e {\n  console.log(filepath);\n  //=\u003e '/Users/luftywiranda/foo/.git'\n});\n```\n\n## API\n\n### gitDirUp([cwd])\n\nReturns a `Promise` for either the filepath or `null` if it couldn't be found.\n\n#### cwd\n\nType: `string`\u003cbr /\u003e\nDefault: `process.cwd()`\n\nDirectory to start from.\n\n## Related\n\n* [git-root-dir](https://github.com/luftywiranda13/git-root-dir) – Find the root directory of a `git` repository\n* [pkg-up](https://github.com/sindresorhus/pkg-up) – Find the closest `package.json` file\n\n## License\n\nMIT \u0026copy; [Lufty Wiranda](https://www.luftywiranda.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluftywiranda13%2Fgit-dir-up","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluftywiranda13%2Fgit-dir-up","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluftywiranda13%2Fgit-dir-up/lists"}