Erzeugen eines Konflikts
Wenn ein Konflikt auftritt, müssen Sie ihn lösen, um Ihre Arbeit abzuschließen. In diesem Schritt werden wir absichtlich einen Konflikt mit unseren beiden bestehenden Repositories, “tutorial” und “tutorial2” erzeugen.
Öffnen Sie zunächst die Datei sample.txt
im Verzeichnis tutorial
auf Ihrem Computer. Fügen Sie den fettgedruckten Text unten in die Datei ein, und führen Sie einen Commit aus.
Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index
commit: Save the status of an index

Öffnen Sie im nächsten Schritt die Datei sample.txt
im Verzeichnis tutorial2
. Fügen Sie den fettgedruckten Text unten in die Datei ein, und führen Sie einen Commit aus.
Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index
pull: Obtain the content of the remote repository

Pushen Sie nun die Änderung von tutorial2
in das Remoterepository.

In unserem aktuellen Remoterepository enthält die Datei sample.txt
die dritte Zeile pull: Obtain the content of the remote repository
und wurde in das Verlaufsprotokoll aufgenommen.
Im nächsten Schritt werden wir den Commit von unserem tutorial
-Repository in das Remoterepository übertragen.

Wie Sie sehen können, löst Git einen Konflikt aus, und lehnt Ihren Push ab.