Add a GitFile class that uses the same locking protocol for writes as git.