我已经编写了使用Python Flask克隆存储库的代码。
from flask import Flask, render_template
app=Flask(__name__)
from git.repo.base import Repo
@app.route('/')
def index():
#here i have to write the code to check if the "FolderToSave" already exists! If it doesn't then only clone
Repo.clone_from("https://github.com/***", "FoldertToSave")
return render_template("index.html")
if __name__=='__main__':
app.run(debug=True)
git中是否有任何方法可以检查本地存储库中是否已经存在克隆?