Check if current directory is a Git repository

You can use:

git rev-parse --is-inside-work-tree

Which will print ‘true’ if you are in a git repos working tree.

Note that it still returns output to STDERR if you are outside of a git repo (and does not print ‘false’).

Taken from this answer: https://stackoverflow.com/a/2044714/12983

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)