Extract git commands into a Git class