python - 用于 Python 的 Github API : PyGithub - get a list of all commits for a particular repository

标签 python git version-control github repository

我正在开发一个脚本,它要求我获取特定存储库的所有提交列表,以及提交的日期和时间。 PyGithub API 中的 Commit 类:

https://github.com/jacquev6/PyGithub/blob/master/doc/ReferenceOfClasses.md#class-commit

在提交日期和提交时间没有任何成员。 关于如何使用 API 获取提交的日期和时间有什么想法吗?

最佳答案

回答有点晚,但您可以从GitAuthor 中获取信息的 GitCommit的 promise 。 这将打印所有提交的日期:

for commit in commits:
    if commit.commit is not None:
        print commit.commit.author.date

关于python - 用于 Python 的 Github API : PyGithub - get a list of all commits for a particular repository,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14909110/

相关文章:

python - 使用 numpy 和 pylab 绘图

git - Docker 使用 token 更改 .gitconfig 以进行私有(private) repo 访问

git - 跳过提交并在 Git 中

git - 执行 git pull 后找不到我的提交

python - setup.py egg_info"尝试安装 beautifulsoup 时失败,错误代码为 1

Python Selenium 获取具有相同文本的所有链接的列表

python - 如何将元组列表转换为 numpy 元组数组?

git rebase 已经 merge 了分支?

git - 如何关闭 Git 警告 "LF will be replaced by CRLF"?

version-control - 如何在 Team Foundation Server 中一次隐藏多个文件夹?