我正在尝试创建一个空分支,并使用gitpython将其推送到git。
new_branch = "branch1"
commit_msg = "root commit"
repo.git.checkout("--orphan", new_branch)
repo.git.rm("-f *")
repo.git.commit("--allow-empty", message=commit_msg)
repo.git.push("origin", new_branch)
print("done")
它在repo.git.rm("-f *")
失败,错误为stderr: 'error: unknown switch
'
如何通过gitpython使用git rm -f *
?