我希望利用ssh键提供的无密码访问的机会来创建新的存储库,而不是每次输入用户名和密码来打开浏览器和登录git托管提供商。如何通过ssh创建新的存储库?
发布于 2017-02-15 07:28:18
GitHub API确实为项目创建提供了一种机制,目前处于alpha状态中。请参阅https://developer.github.com/v3/projects/#create-a-repository-project
发布于 2017-02-20 01:21:02
我使用这个/usr/local/bin/github
#!/bin/dash
# Create a personal access token here
#
# https://github.com/settings/tokens
#
# and make sure it has the 'repo' scope.
TOKEN=`cat /home/user/github_token`
REPO=$2
curl -s -XPOST -H 'Authorization: token '$TOKEN https://api.github.com/user/repos -d '{"name":"'$REPO'"}'|egrep -w 'already|"name":'|grep -o '.*[^,]'|cut -d: -f2|perl -pe 's/^ "(.*)"/$1/;s/name already exists on this account/already exists/'|perl -pe "s/$REPO/successfully created/"它以github init myrepo的形式运行。从CLI创建和分叉项目非常有用。
https://stackoverflow.com/questions/42318062
复制相似问题