Github Authentication Failed

Теги: git  github 

Редкая, но противная ошибка, связанная с потерей связи локальных репозиториев с удаленными

$ git remote add origin git@github.com:that/this.git
fatal: remote origin already exists.

$ git push -u origin master
fatal: 'that' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

При этом на запрос по SSH Github возвращает success. В этом случае необходимо переопределить ssh url дл remote origin. Делается это так

git remote set-url origin git@github.com:that/this.git

источник