24 | Handling Conflicts |
You canât develop a project with other developers without generating conflicting versions of code from time to time. Git goes a long way toward helping you resolve those automatically, but sometimes it canât.
For example, the code shown on the opposite page shows two
different solutions to the same problem. You must tell Git how to
fix the conflict because it doesnât know which version is correct.
They both make changes to the exact same lines of code. You can
find out which file or files have conflicts in two ways: the output
from the failed git merge
, or
git status
.
You can find conflicts within a file by looking for
<<<<<<<
âseven
lesser than signsâwith a commit such as
HEAD
. The original codeâthe ...
Get Pragmatic Guide to Git now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.