【问题标题】:How to see repositories where I am contributor in github?如何在 github 中查看我作为贡献者的存储库?
【发布时间】:2021-02-08 15:01:13
【问题描述】:

我为 GitHub 中的多个存储库做出了贡献。现在,我正在寻找其中一个,我忘记了它的名字。如何单独找到它们作为列表?

为此目的,我知道的唯一方法是 Customize your pins 在所有您的存储库您的分叉存储库贡献的个人资料中存储库位于一起。

【问题讨论】:

    标签: git github repository


    【解决方案1】:

    您可以通过 Github public api 以及一点点 bash 和 jq 来实现。

    API 是分页的,因此您需要获取您在 github 上的提交总数:

    curl \                                                                                                                                                                                                                            ~ Jungle
      -H "Accept: application/vnd.github.cloak-preview+json" \
      "https://api.github.com/search/commits?q=author:YOUR_USERNAME" \
     | jq '.total_count'
    

    您需要将total_count 除以 100 才能知道分页的时间。

    然后滚动浏览页面:

    for i in {1..NUMBER_OF_PAGES}; do curl \
      -H "Accept: application/vnd.github.cloak-preview+json" \
      "https://api.github.com/search/commits?q=author:YOUR_USERNAME&per_page=100&page=$i" \
     | jq '.items[].repository.full_name' >> /tmp/results.txt; done;
    

    然后sort -u /tmp/results

    【讨论】:

      猜你喜欢
      • 2022-01-27
      • 2019-07-30
      • 2018-07-28
      • 1970-01-01
      • 2014-01-09
      • 1970-01-01
      • 2015-03-08
      • 2019-07-13
      • 2021-04-10
      相关资源
      最近更新 更多