Mac OSの場合
brew install gh
(他OSは一旦省きます)
ghコマンドの認証をします
gh auth login
沿っていきます。
% gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? SSH
? Upload your SSH public key to your GitHub account? /Users/akito/.ssh/id_rsa.pub
? How would you like to authenticate GitHub CLI? Login with a web browser
! First copy your one-time code: AF2D-350E
- Press Enter to open github.com in your browser...
✓ Authentication complete. Press Enter to continue...
- gh config set -h github.com git_protocol ssh
✓ Configured git protocol
✓ Uploaded the SSH key to your GitHub account: /Users/akito/.ssh/id_rsa.pub
✓ Logged in as akuraya
リポジトリを作る
git init github_template
cd github_template
gh repo create
? Repository name github_template
? Repository description
? Visibility Public
? This will add an "origin" git remote to your local repository. Continue? Yes
✓ Created repository akuraya/github_template on GitHub
✓ Added remote git@github.com:akuraya/github_template.git