extract function SetupGit