is-git-repo

check if a directory is a git repo

Usage no npm install needed!

<script type="module">
  import isGitRepo from 'https://cdn.skypack.dev/is-git-repo';
</script>

README

is-git-repo

Check if a given directory is a git repository.

isGitRepo('/home/user/my-repo', function(git) {
  console.log(git) // boolean
});

Supports both regular and bare repositories.

License

MIT