DC4

githubで二段階認証を設定するとhttpsプロトコル使用時にpushでエラーが出る。

GitHubでは二段階認証の設定が可能です。

Two-factor Authentication

二段階認証を設定している状態でhttpsプロトコルを使用するとアクセストークンが必要になります。

$ git push origin master 
Username for 'https://github.com': ***
Password for 'https://***@github.com': 

fatal: Authentication failed for 'https://github.com/`UserID`/`brunch`.git/'

セットアップ時のgit remote add originSSHを指定していれば問題ないのですが、 httpsを選択してしまっている場合

$ git remote -v
origin  https://github.com/`UserID`/`brunch`.git (fetch)
origin  https://github.com/`UserID`/`brunch`.git (push)

$ git remote set-url origin git@github.com:`UserID`/`brunch`.git

$ git remote -v
origin  git@github.com:`UserID`/`brunch`.git (fetch)
origin  git@github.com:`UserID`/`brunch`.git (push)

こんな感じで変更できます。