Errors Git

Contents
fatal: No such remote 'origin'

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

2

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

Share in social media: