gpt4 book ai didi

macos - 通过终端从 github 访问提交历史记录?

转载 作者:太空狗 更新时间:2023-10-29 14:13:20 24 4
gpt4 key购买 nike

需要一些快速帮助。新手终端用户在这里。尝试使用这些说明:https://developer.github.com/v3/repos/statistics/#commit-activity获取特定用户的提交历史记录。

但是,我不知道该怎么办:

GET /repos/:owner/:repo/stats/contributors

当我用我正在使用的特定名称替换 owner 和 repo 时,没有任何反应,因为我在我的终端中收到此错误:

-bash: GET: command not found

这是一个非常时间敏感的问题,帮助!谢谢!

最佳答案

可以关注这个curl tutorial using GitHub's API看看你会如何翻译

GET /repos/:owner/:repo/stats/contributors

如您所见in the comments ,不应包含“:”。

curl --include https://api.github.com/users/caspyin

Pass user credential to basic auth to access protected resources like a users starred gists, or private info associated with their profile

curl --user "caspyin:PASSWD" https://api.github.com/gists/starred
curl --user "caspyin:PASSWD" https://api.github.com/users/caspyin

Passing just the username without the colon (:) will cause you to be prompted for your account password.
This avoids having your password in your command line history

curl --user "caspyin" https://api.github.com/users/caspyin

在您的情况下,替换 <owner><reponame>由正确的所有者和 repo 名称:

curl https://api.github.com/repos/<owner>/<reponame>/stats/contributors

关于macos - 通过终端从 github 访问提交历史记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25985976/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com