使用(J)Git获取GitHubs存储库描述
在GitHub中,每个存储库都可以有一个简短的描述,显示在使用(J)Git获取GitHubs存储库描述,git,github,jgit,Git,Github,Jgit,在GitHub中,每个存储库都可以有一个简短的描述,显示在code |网络|请求拉取|问题| Wiki |图形|设置栏下 我可以,但我想用JGit或Git来阅读和更改它。这可能吗 (首先,我试图阅读.git/description,但GitHub中的每个存储库似乎都包含相同的文本: Unnamed repository; edit this file 'description' to name the repository. .git/description是否在任何地方使用?该.git/de
code |网络|请求拉取|问题| Wiki |图形|设置
栏下
我可以,但我想用JGit或Git来阅读和更改它。这可能吗
(首先,我试图阅读.git/description
,但GitHub中的每个存储库似乎都包含相同的文本:
Unnamed repository; edit this file 'description' to name the repository.
.git/description
是否在任何地方使用?该.git/description与GitHub repo的description字段无关
您可以通过简单的卷曲(即与git
无关)获得该字段,如下所示:
使用PATCH
http方法,您可以非常轻松地编辑它:
curl -u "$user:$pass" -X PATCH -d '{"name":"$reponame","description":"new_value"}' https://api.github.com/repos/$user/$reponame
(与“”中相同)谢谢,GitHub API可以获取/编辑描述。所以这个描述在Git存储库本身的某个地方并不存在(我首先希望是这样)?@son123我添加了一个编辑示例。但这种描述并不是git回购协议的一部分。
curl -u "$user:$pass" -X PATCH -d '{"name":"$reponame","description":"new_value"}' https://api.github.com/repos/$user/$reponame