是否可以创建一个新项目并将该新项目推送到GitHub而不必打开浏览器,登录Github,并创建一个新项目供您通过GitHub网站推送?
答案 0 :(得分:2)
答案 1 :(得分:0)
没有
您必须首先在GitHub中创建存储库。
答案 2 :(得分:0)
你不能。 Github是git的包装器,它不允许你这样做。 原因是在github repos中有github权限,无法通过git管理。
以下是同一个问题:How to create a new repo at Github using git bash?
另一种方法可能是使用github API: https://developer.github.com/v3/repos/#create
答案 3 :(得分:0)
您可以将其添加到您的.bash_profile中:
echo 'mkrepo () { curl -u "<username>" https://api.github.com/user/repos -d "{\"name\":\"$@\"}" ; }' >> ~/.bash_profile
source ~/.bash_profile
然后输入mkrepo <new-repo-name>
,它将创建它。 (<username>
是您在github上的用户名,<new-repo-name>
是您要调用新存储库的名称。