Skip to main content
  1. Learn
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Verwenden von Git
  6. Verwenden von Git unter Windows
  7. Make a conflict
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

Make a conflict

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. 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

Record the status of commit 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

pull Acquire the contents of a remote repository.

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

Push to the remote repository

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.

Git raises a conflict and rejects your push

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

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life