Git permission checking. Fixes #38