Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用(J)Git获取GitHubs存储库描述_Git_Github_Jgit - Fatal编程技术网

使用(J)Git获取GitHubs存储库描述

使用(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

在GitHub中,每个存储库都可以有一个简短的描述,显示在
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