def create_local_git_repo(files=None, branch=None, submodules=None, folder=None, commits=1, tags=None, origin_url=None): tmp = folder or temp_folder() tmp = get_cased_path(tmp) if files: save_files(tmp, files) git = Git(tmp) git.run("init .") git.run('config user.email "*****@*****.**"') git.run('config user.name "Your Name"') if branch: git.run("checkout -b %s" % branch) git.run("add .") for i in range(0, commits): git.run('commit --allow-empty -m "commiting"') tags = tags or [] for tag in tags: git.run("tag %s" % tag) if submodules: for submodule in submodules: git.run('submodule add "%s"' % submodule) git.run('commit -m "add submodules"') if origin_url: git.run('remote add origin {}'.format(origin_url)) return tmp.replace("\\", "/"), git.get_revision()