1.0.4 • Published 4 years ago

find-git-root v1.0.4

Weekly downloads
33,026
License
MIT
Repository
github
Last release
4 years ago

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