Source: Github Authentication Failed

← Rendered

markdown source:

---
description: Ошибка аутентификации на Github
tags: git github
title: Github Authentication Failed
---
Редкая, но противная ошибка, связанная с потерей связи локальных репозиториев с удаленными

```shell
$ 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. Делается это так

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

[источник](https://stackoverflow.com/a/26955444/15966204)

- [[git]]
- [[github-authentication]]


[git]: ../lists/git "Git"
[github-authentication]: github-authentication "Github authentication"