2.4 KiB
2.4 KiB
title, intro, redirect_from, versions, shortTitle, ms.openlocfilehash, ms.sourcegitcommit, ms.translationtype, ms.contentlocale, ms.lasthandoff, ms.locfileid
| title | intro | redirect_from | versions | shortTitle | ms.openlocfilehash | ms.sourcegitcommit | ms.translationtype | ms.contentlocale | ms.lasthandoff | ms.locfileid | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Обработка ошибок не быстрого перемещения вперед | Иногда Git не может внести изменения в удаленный репозиторий без потери фиксаций. В этом случае ваша передача данных будет отклонена. |
|
|
Non-fast-forward error | 45405455b20d71ca01d61f23d949be4ec5964356 | 5f40f9341d |
MT | ru-RU | 10/04/2022 | 148009030 |
Если другой пользователь отправил изменения в ту же ветвь, что и вы, GIT не сможет отправить ваши изменения:
$ git push origin main
> To https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git
> ! [rejected] main -> main (non-fast-forward)
> error: failed to push some refs to 'https://{% data variables.command_line.codeblock %}/<em>USERNAME</em>/<em>REPOSITORY</em>.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 origin
# Fetches updates made to an online repository
$ git merge origin YOUR_BRANCH_NAME
# Merges updates made online with your local work
Кроме того, можно просто использовать git pull для одновременного выполнения обеих команд:
$ git pull origin YOUR_BRANCH_NAME
# Grabs online updates and merges them with your local work