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"
Logo

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!

更多推荐