Tip: Resolving Conflicts with git checkout –theirs
June 18, 2025
tips
No products in the cart.
When working in a team, it’s common for two people to edit the same file and cause a conflict during a merge.
The usual process is to open the file, look for the <<<<<<< markers, and manually decide which changes to keep. But Git gives us quicker tools for certain scenarios.
If you want to resolve a conflict by accepting the version from the branch you’re merging into your current branch, you can use:
This replaces the conflicted file with the version from the other branch.
Example:
You’re on main and you run: git merge feature-branch
If there’s a conflict in script.py, and you decide to keep the changes from feature-branch, just run:
When to use this:
2025 Erik Elizalde