【发布时间】:2022-07-13 23:08:06
【问题描述】:
好时光!
我想通过终端从当前的 git 仓库在 Github 上创建一个新的代码空间。
我可以使用此参数从gh 创建代码空间
$ gh codespace create
? Repository: [? for help, tab for suggestions]
然后以用户名/repo-name 格式输入 repo 名称。
【问题讨论】:
标签: git github codespaces
好时光!
我想通过终端从当前的 git 仓库在 Github 上创建一个新的代码空间。
我可以使用此参数从gh 创建代码空间
$ gh codespace create
? Repository: [? for help, tab for suggestions]
然后以用户名/repo-name 格式输入 repo 名称。
【问题讨论】:
标签: git github codespaces
您可以从 git URL 中获取用户名/repo-name 格式的 repo 名称,然后从中创建一个代码空间。
git config --get remote.origin.url
username/repo-name 格式$ git config --get remote.origin.url | sed 's/https:\/\/github\.com\///' | sed 's/\.git$//'
$ git config --get remote.origin.url | sed 's/https:\/\/github\.com\///' | sed 's/\.git$//' | xargs gh codespace create -r
【讨论】: