find-git-root
v1.1.0
Published
recursively find the closest .git/
Readme
find-git-root
Recursively find the closest .git/ and return repo path, support git worktree.
Installation
npm install find-git-rootUsage
'use strict'
const findGitRoot = require('find-git-root')
// git clone url /home/you/repo
const root = findGitRoot('/home/you/repo/somedir/somefile')
// => /home/you/repo/.git
const root = findGitRoot('/home/you/repo/somedir')
// => /home/you/repo/.git