git merge

Practice git merge from memory. git merge --abort rewinds the index and working tree to the pre-merge state. Use when conflicts are messier than expecte

Cancel an in-progress merge and restore the previous state.

git merge --abort

git merge --abort rewinds the index and working tree to the pre-merge state. Use when conflicts are messier than expected; safe as long as you haven't committed.

Safety: Inspect first and avoid rewriting shared history unless the team expects it.

Merge remote-tracking main into your current branch.

git merge origin/main

Merges the already-fetched origin/main into the current branch without re-fetching. Useful when you ran git fetch separately and want to merge offline.

Safety: Inspect first and avoid rewriting shared history unless the team expects it.

Build the habit: GitDrill drills git merge and the rest of the Git workflow until the safe first move is automatic. Try a Git drill.