eer*_*icc 7 python-3.x gitpython
检出分支很有效,但我还需要检出给定 Git 存储库中的某个提交 ID。
我的意思是相当于
git clone --no-checkout my-repo-url my-target-path
cd my-target-path
git checkout my-commit-id
Run Code Online (Sandbox Code Playgroud)
我怎样才能用 gitpython 做到这一点?
repo = git.Repo.clone_from(repo_url, repo_path, no_checkout=True)
repo.git.checkout(commit_id)
Run Code Online (Sandbox Code Playgroud)
您可以在文档中找到更多详细信息。
| 归档时间: |
|
| 查看次数: |
2704 次 |
| 最近记录: |