Moving `git init` actions into function