find-git-root
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i find-git-root

    Weekly Downloads

    94,872

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    4.01 kB

    Total Files

    7

    Last publish

    Collaborators

    • banyudu