表示されたエラー
Invocation failed Unexpected end of file from server
や
push failed github
や
error: unable to read askpass response
といったもの。
どんな状況だったか?
Android Studio で新規プロジェクトを GitHub に作成する。
すると、リポジトリの作成はするのだが、コードは上がっていない状態で Android Studio ではエラーが出る。
試したけどダメだったこと
Android Studio と GitHub の再認証。
改善策
File → Invalidate Caches.. を選択する。
すると出てくるダイアログの Optional に元からチェックが入っていた Clear VCS Log caches and indexes はそのままにしました。
ちなみにこの英文の意味は、IntelliJ によると、
Clear VCS Log caches and indexes: remove the cache and indexes of the VCS Log.
Enable this option if you are certain that your VCS Log indexes are broken, for example, if the Log search doesn't work correctly.
とのこと。
Invalidate and Restart を選択し、GitHub に push をすれば改善できました。
参考 URL