Ошибки Git

Содержание
fatal: No such remote 'origin'
error: failed to push some refs to
fatal: Could not read from remote repository
fatal: repository 'x' not found
error: unable to create file Filename too long
Error cloning remote repo 'origin'
Другие статьи про Git

fatal: No such remote 'origin'

fatal: No such remote 'origin'

Скорее всего Вы пытаетесь выполнить

$ git remote set-url origin https://github.com/name/project.git

Попробуйте сперва выполнить

$ git remote add origin https://github.com/name/project.git

error: failed to push some refs to

To https://github.com/YourName/yourproject.git
! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/YourName/yourproject.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Скорее всего Вы пытаетесь выполнить git push origin master в новом репозитории.

При этом, когда Вы создавали удалённый репозиторий на github Вы отметили опцию initialize with readme file.

Таким образом на удалённом репозитории файл README.md есть, а на локальном нет. Git не понимает как такое могло произойти и предполагает, что на удалённый репозиторий кто-то (возможно Вы) добавил что-то неотслеженное локальным репозиторием.

Первым делом попробуйте

$ git pull origin master

$ git push origin master

Git скачает файл README.md с удалённого репозитория и затем можно будет спокойно пушить

Если сделать pull не получилось, например, возникла ошибка

From https://github.com/andreiolegovichru/heiheiru
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories

Попробуйте

$ git pull --allow-unrelated-histories origin master

$ git push origin master

ERROR: Permission to AndreiOlegovich/qa-demo-project.git denied to andreiolegovichru. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Возможная причина - git не видит ваш ключ. Либо ваш ключ уже используется для другого удалённого хранилища.

Решить можно удалив стандарный ключ id_rsa.pub создать новую пару и добавить на удалённое хранилище.

Если этот способ не подходит - нужно настроить config.

fatal: Could not read from remote repository

no such identity: /c/Users/Andrei/ssh/github: No such file or directory git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Первым делом нужно проверить - добавлен ли ключ на удалённый репозиторий. Включен ли SSH агент и добавлен ли в него этот ключ

eval `ssh-agent -s`

Agent pid 1234

ssh-add ~/.ssh/id_rsa

Identity added: /c/Users/Andrei/.ssh/id_rsa (AzureAD+Andrei@AredelComLap0141)

fatal: repository 'x' not found

Если вы получили ошибку

fatal: repository 'x' not found

Под Windows - попробуйте удалить существующие git credentials

Control Panel User Accounts Credential Manager (Manage your credentials) Windows Credentials

Всё что связано с Git или GitHub нужно удалить (на ваш страх и риск)

error: unable to create file Filename too long

Если вы получили ошибку

error: unable to create file Filename too long

Первое, что советую сделать - проверить разрешены ли длинные пути в gitconfig

Если нет, то разрешить их можно командой

git config --system core.longpaths true

В Windows файл gitconfig находится в директории

C:\Program Files\Git\etc

[diff "astextplain"] textconv = astextplain [filter "lfs"] clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process required = true [http] sslBackend = openssl sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt [core] autocrlf = true fscache = true symlinks = true fsmonitor = true longpaths = true [pull] rebase = false [credential] helper = manager [credential "https://dev.azure.com"] useHttpPath = true [init] defaultBranch = master

Если вы работаете в Windows нужно разрешить использование длинных имён файлов.

Error cloning remote repo 'origin'

Если вы получили ошибку

Cloning the remote Git repository ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- git@github.com:AndreiOlegovich/robot_web_ui_test.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Похожие статьи
Git
.gitignore
Необходимые Bash команды
Remote
GitHub
GitLab
Ошибки
Git Bash
DevOps

Поиск по сайту

Подпишитесь на Telegram канал @aofeed чтобы следить за выходом новых статей и обновлением старых

Перейти на канал

@aofeed

Задать вопрос в Телеграм-группе

@aofeedchat

Контакты и сотрудничество:
Рекомендую наш хостинг beget.ru
Пишите на info@urn.su если Вы:
1. Хотите написать статью для нашего сайта или перевести статью на свой родной язык.
2. Хотите разместить на сайте рекламу, подходящую по тематике.
3. Реклама на моём сайте имеет максимальный уровень цензуры. Если Вы увидели рекламный блок недопустимый для просмотра детьми школьного возраста, вызывающий шок или вводящий в заблуждение - пожалуйста свяжитесь с нами по электронной почте
4. Нашли на сайте ошибку, неточности, баг и т.д. ... .......
5. Статьи можно расшарить в соцсетях, нажав на иконку сети: