🔀 Merging
Merging combines changes from one branch into the branch you’re currently on.
Basic Merge
git merge feature-name
This merges the branch feature-name into your current branch (often main or develop).
Fast-Forward Merge (no new commit created)
If no other changes have been made in the target branch since branching:
git merge --ff-only feature-name
✅ Keeps history clean without extra merge commits.
When Conflicts Appear
If you see a merge conflict:
- Open the affected files in your editor.
-
Look for conflict markers:
<<<<<<< HEAD Your changes ======= Their changes >>>>>>> feature-name - Edit to keep the correct content.
-
Stage the resolved files:
git add . -
Complete the merge:
git commit
Check Merge Status
git status
Shows if the merge is in progress or complete.