Merge commits are used to integrate changes made to a git branch into the main branch. They are done by creating or switching to a difference branch, editing or changing that branch, creating a pull request to preview the merge and ensure the branches are mergable, and finally confirming the request and completing the merge.