Gr1*_*r1N 3 python git gitpython
随着git status我可以了解未公布的提交计数信息:
» git status
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
# (use "git push" to publish your local commits)
#
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)
我想用GitPython获取未发布的提交(或计数).我找到的文档repo.git.status(),但这不是我想要的.
您正在寻找的命令是:
repo.iter_commits('BRANCH..BRANCH@{u}')
Run Code Online (Sandbox Code Playgroud)
或者如果你想要这个作为一个列表:
list(repo.iter_commits('BRANCH..BRANCH@{u}'))
Run Code Online (Sandbox Code Playgroud)
该BRANCH@{u}语法是指上游分支BRANCH.
| 归档时间: |
|
| 查看次数: |
2445 次 |
| 最近记录: |