Skip to content
techsnow

Branches

Merging

git switch main
git merge login-page

Git combines the work from login-page into main.

Merge conflicts

If both branches changed the same lines, Git can't decide which to keep and marks the conflict in the file:

<<<<<<< HEAD
<h1>Welcome</h1>
=======
<h1>Welcome to TechSnow</h1>
>>>>>>> login-page
  • Edit the file and keep the version you want (or combine them).
  • Delete the <<<<<<<, ======= and >>>>>>> lines.
  • Run git add on the file, then git commit.