如何通过命令行添加/更改github的存储库描述

问题描述:

我了解了如何通过curl使用命令行添加存储库,以及如何使用git commit添加提交的描述,但是如何通过命令行添加存储库描述?

I learned how to add a repository via the command line with curl and how to add a description for a commit with git commit, but how to add a repository description via the command line?

此答案中所述,回购描述在GitHub网站上看到的仅适用于GitHub.

As noted in this answer, a repo description as seen on the GitHub website is specific to GitHub only.

因此 .git/description 不起作用(仅 gitweb 正在使用它)

So .git/description would not work (only gitweb is using it)

可以使用GitHub API,但是您需要将动词 PATH 与curl命令集成以便编辑您的存储库.

Using the GitHub API would, but you need to integrate the verb PATH with your curl command in order to edit your repo.

curl -H "Authorization: token OAUTH-TOKEN" \
     --request PATCH \
     --data '{"name":"repo", "description":"a new description"}' \
     https://api.github.com/repos/:owner/:repo