Loading tutorials
Intermediate · Mid: 16 chapters · 36 min read. States assumed prerequisites
Start readinggit log. It explains how Git decides what a merge should produce, which is the basis for understanding why conflicts happen later.git log. It covers the two shapes a successful merge can take, and how to choose between them.git merge. You should also know why a merge can stop with a conflict, which the previous chapter covered. Here you learn to read what Git writes into a conflicted file.git diff. It uses the config.txt conflict from the previous chapters. When git merge feature stops, Git has not finished. It has put the repository into a merge state, and you can examine that state with three commands befogit status output. You should also know what a conflict looks like in a file. Here you will learn how to abandon an unfinished merge and get back to a clean state.git merge, read conflict markers, and edit a conflicted file by hand. Here you learn how to confirm a resolution is correct before and after you commit it.git add. Sometimes the right fix for a conflict is to keep one version unchanged. Git has commands for that, and the words "ours" and "theirs" appear in several places with different meanings.git status during a merge, and finish a merge with git add and git commit. It covers git mergetool, which opens a visual tool for each conflicted file.git status, and finish a merge with git add and git commit. Some conflicts have no markers to edit. Git stops because it cannot decide whether a file should exist, where it lives, or how to combine its bytes.