Skip to content

banyudu/find-git-root

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

find-git-root

Shields Badge

Recursively find the closest .git/ and return repo path, support git worktree.

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

About

recursively find the closest .git/

Resources

License

Stars

Watchers

Forks

Packages

No packages published