find-git-root
v1.0.4
Published
recursively find the closest .git/
Downloads
392,799
Readme
find-git-root
Recursively find the closest .git/
and return repo path
Installation
$ npm install find-git-root
Usage
'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