Back

Merging and Pull Requests

Merging combines the work from one branch into another. On teams you usually merge through a Pull Request so someone can review the changes first. If two branches changed the same lines, Git can't decide on its own and you get a merge conflict to fix by hand.

# Merge a branch locally
git checkout main
git pull
git merge feature/login

# Conflict markers look like this:
<<<<<<< HEAD
const title = "Home"
=======
const title = "Welcome"
>>>>>>> feature/login

# Fix the file, then:
git add .
git commit

# After a PR is merged on GitHub
git checkout main
git pull
git branch -d feature/login

Roadmap