Ошибки 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'
error: Your local changes to the following files would be overwritten by checkout
Другие статьи про 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.

error: Your local changes to the following files would be overwritten by checkout",

Означает, что вы внесли изменения в файл в какой-то ветке, и хотите сделать чекаут в родительскую, например в master, но кто-то уже поменял этот файл в родительской ветке и вам нужно либо закоммитить его в свою ветку, чтобы дальше он отслеживался там, либо сбросить его в stash

Article author: Andrei Olegovich

Похожие статьи
Please configure_the_postgresql_binary_path
Job for postgresql.service failed because the control process exited with error code
Ошибки Postgres
Ifconfig Command Not Found
lsb_release: command not found
Please configure_the_postgresql_binary_path
Job for postgresql.service failed because the control process exited with error code
Ошибки Postgres
Please configure_the_postgresql_binary_path
Job for postgresql.service failed because the control process exited with error code
Ошибки Postgres
ifconfig command not found Debian
lsb_release: command not found
Зависла Ubuntu что делать
Banner image

Search this site

Subscribe to Telegram channel @aofeed to follow new articles and updates to old ones

Go to channel

@aofeed

Ask a question in the Telegram group

@aofeedchat

Contacts and cooperation:
I recommend our hosting beget.ru
Write to info@urn.su, info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: