Calm Merges
Abort, and avoid conflicts.
Sometimes a conflict appears and you're just not ready to deal with it. Maybe it's late, or you need to ask a teammate. There's an emergency exit.

- Not ready for this conflict?
- There's an emergency exit
- Back to before the merge
git merge --abort
The merge failed with a conflict. Git merge, dash dash abort, cancels the whole merge. Status shows a clean working tree, and the file is exactly as it was before. Nothing is lost. You can try the merge again whenever you're ready.
git merge title Auto-merging index.html CONFLICT (content): Merge conflict in index.html Automatic merge failed; fix conflicts and then commit the result. git merge --abort git status On branch main nothing to commit, working tree clean head -1 index.html <h1>Sam's Site</h1>
Fewer conflicts
You can't avoid conflicts completely, but you can make them rare, and small. Merge often, so branches don't drift far apart. Keep branches short lived. Make small, focused commits. And talk to your team, when two people need to change the same file.
Summary
Git merge dash dash abort cancels a merge safely. Merging often keeps conflicts small. Next, your turn to practise branches.
Key takeaways- git merge --abort
- Merge often
- Short-lived branches