Создание конфликта
Когда возникает конфликт, вам нужно будет его разрешить, чтобы выполнить работу. На этом этап е мы намеренно создадим конфликт, используя два наших существующих репозитория, «tutorial» и «tutorial2».
Сначала откройте файл sample.txt
в каталоге tutorial
на своем компьютере. Добавьте выделенный ниже жирный текст в файл и зафиксируйте его.
Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index
commit: Save the status of an index

Затем откройте файл sample.txt
в каталоге tutorial2
. Добавьте выделенный ниже жирный текст в файл и зафиксируйте его.
Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index
pull: Obtain the content of the remote repository

Теперь передайте изменение из tutorial2
в удаленный репозиторий.

В нашем текущем удаленном репозитории файл sample.txt
содержит третью строку pull: Obtain the content of the remote repository
и зафиксирован в журнале.
Далее мы собираемся передать фиксацию из нашего репозитория tutorial
в удаленный репозиторий.

Как видите, Git обнаруживает конфликт и отклоняет ваш запрос.