如何通过命令行添加/更改github的存储库描述 [英] How to add/change a repository description for github via the command line

查看:75
本文介绍了如何通过命令行添加/更改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

这篇关于如何通过命令行添加/更改github的存储库描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆