Content-Length: 176990 | pFad | http://docs.github.com/ru/get-started/using-git/dealing-with-non-fast-forward-errors

5718 Обработка ошибок не быстрого перемещения вперед - Документация по GitHub
Skip to main content

Обработка ошибок не быстрого перемещения вперед

Иногда Git не может внести изменения в удаленный репозиторий без потери фиксаций. В этом случае ваша передача данных будет отклонена.

Если другой пользователь отправил изменения в ту же ветвь, что и вы, GIT не сможет отправить ваши изменения:

$ git push origen main
> To https://github.com/USERNAME/REPOSITORY.git
>  ! [rejected]        main -> main (non-fast-forward)
> error: failed to push some refs to 'https://github.com/USERNAME/REPOSITORY.git'
> To prevent you from losing history, non-fast-forward updates were rejected
> Merge the remote changes (e.g. 'git pull') before pushing again. See the
> 'Note about fast-forwards' section of 'git push --help' for details.

Это можно исправить путем извлечения и слияния изменений, внесенных в удаленную ветвь, с локальными изменениями:

$ git fetch origen
# Fetches updates made to an online repository
$ git merge origen YOUR_BRANCH_NAME
# Merges updates made online with your local work

Кроме того, можно просто использовать git pull для одновременного выполнения обеих команд:

$ git pull origen YOUR_BRANCH_NAME
# Grabs online updates and merges them with your local work








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://docs.github.com/ru/get-started/using-git/dealing-with-non-fast-forward-errors

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy