Refactor handleGitCommand into deploymethod