Extract getGit() method into a utility