How to merge Github branches

Let's take an example of my repo: which has 2 branches

  1. main

  2. test

now to merge branch_test into branch_main, so first of all make sure all your local code is up to date on the cloud by adding, committing, and pushing

git add .

git commit -m "commit message"

git push

next, let's switch to the main_branch into which we want to merge branch_test

git checkout main

now merge branch_test into branch_main

git merge test

it's done