How can I tell if a given directory is part of a git respository?
(The following is in python, but bash or something would be fine.)
os.path.isdir(\'.svn
If you'd prefer to look for a .gitdirectory, here's a cute way of doing that in Ruby:
.git
require 'pathname' def gitcheck() Pathname.pwd.ascend {|p| return true if (p + ".git").directory? } false end
I'm unable to find something similar to ascend in Python.