環境
OSX High Sierra
git version 2.14.3 (Apple Git-98)
hub version 2.2.9
問題
hubコマンドで認証に失敗する。
$ hub clone dyoshikawa/my-private-repo
Error getting repository: Unauthorized (HTTP 401)
Bad credentials
解決法
https://github.com/github/hub/issues/1067
GitHubのダッシュボードからSetting→Developer settings→Personal access tokensを開く。
tokenをRegenerateして新しく生成されたトークンをコピー。
Macで~/.config/hubをエディタで開き、oauth_tokenを置換する。
~/.config/hub
github.com:
- user: dyoshikawa
oauth_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
protocol: https