Skip to content

jtilly/git_root

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

git_root

Find the root of a git repository (pilfered from https://stackoverflow.com/a/53675112)

Installation

# pick one
pip install git+https://github.com/jtilly/git_root
conda install -c conda-forge git_root
pip install git_root

Usage

from git_root import git_root

git_root()
# /home/user/my_repo

git_root('dir1', 'file')
# /home/user/my_repo/dir1/file

git_root('dir1/file')
# /home/user/my_repo/dir1/file

About

Python package that finds the root of a git repo

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages