How to add/change a repository description for github via the command line
·
Answer a question
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?
Answers
As noted in this answer, a repo description as seen on the GitHub website is specific to GitHub only.
So .git/description would not work (only gitweb is using it)
Using the GitHub API would, but you need to integrate the verb PATH with your curl command in order to edit your repo.
curl \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
--data '{"name":"repo", "description":"a new description"}' \
https://api.github.com/repos/OWNER/REPO
Using GitHub CLI gh api:
gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
/repos/OWNER/REPO \
-f name='Hello-World'
-f description='This is your first repository'
Or gh repo edit:
gh repo edit OWNER/REPO -d "new Description"
更多推荐


所有评论(0)