def set_git_url(path: str, url: str): repo = Repo.init(path) repo.index.add(listdir(path)) repo.index.commit("First commit") repo.create_head('master') repo.create_remote('origin', url=url + '.git')