Git: Solving conflicts

In both push and pull there is a problem to consider: if the remote contains changes incompatible with your set of commits, the operation will fail.

This happens when the remote contains changes to a file you’ve been working on too, which affects lines of code you worked on.

Sometimes Git can figure it out and there’s no problem.

But sometimes, you have a conflict.

In the case of push this is usually solved by pulling changes, analyzing the conflicts, and then making a new commit that solves them.

In the case of pull, your working copy will automatically be edited with the conflicting changes, and you need to solve them, and make a new commit so the codebase now includes the problematic changes that were made on the remote.

Lessons in this unit:

0: Introduction
1: Installing Git
2: Initialize a repository
3: Commit changes
4: Branches
5: Push and pull
6: Working with a remote
7: ▶︎ Solving conflicts
8: .gitignore
Are you intimidated by Git? Can’t figure out merge vs rebase? Are you afraid of screwing up something any time you have to do something in Git? Do you rely on ChatGPT or random people’s answer on StackOverflow to fix your problems? Your coworkers are tired of explaining Git to you all the time? Git is something we all need to use, but few of us really master it. I created this course to improve your Git (and GitHub) knowledge at a radical level. Launching May 21, 2024. Join the waiting list!