+-
如何在github上创建新的repo?[重复]
这个问题在这里已经有了答案:
从命令行创建Github Repository。 (3个答案)
封闭 上月.

enter image description here搜索google,有办法在Github上创建repo.我要在github上创建新的repo,而不在Github上创建repo,只用git或终端,不在github上创建新的repo,有没有办法只用git或终端创建项目?

1
投票

是的,你可以用终端创建一个仓库。有两件事 Github Api 和 卷曲

如果你想知道你的电脑中是否安装了curl in,你只需要输入 curl -help 在您的终端中。如果没有出现错误,说明已经安装好了。

您可以按照 Github Api 链接并滚动到章节名称 Creates a new repository for the authenticated user根据你的需要,可以添加更多的参数,这里我只是添加了两个参数来检查它是否正常工作

参数1(需要)--------。 name of your repository

参数2(我自己测试用)--------。making the repository private

然后用这个命令

curl -u "Your_github_username" https://api.github.com/user/repos -d '{"name":"test123","private":"true"}'

请务必更换 Your_github_username 用你实际的github名称,我把我的仓库命名为 test123. 你想叫什么名字都可以

我把它变成了私人的。你不需要写 private:TRUE如果你想让它公开

然后按 Enter. 之后,它会问你的github密码,写好后按回车键。

一段代码会运行,你会发现clone_url是你仓库的链接。

enter image description here

3
投票

是的,用 GitHub CLI.

gh repo create [name]