How to Resolve Merge Conflicts Manually: Step-by-Step Guide

Dealing with merge conflicts can feel a bit intimidating at first, but once you understand the process, it's just another part of collaborating on code.

In this step-by-step guide, let’s walk you through how to manually resolve merge conflicts, so you can get your code merged smoothly without losing any important work.

How To Resolve Merge Conflicts Manually

Steps to follow:

1. Open your project in VS code and click on 'Terminal'.

2. Click on 'New Terminal'.

3. Enter the command 'git merge <branch_name>' and press 'Enter' to run it.

4. The merge conflicts will show up in the terminal.

5. Click on the 'Close' icon.

6. Click on 'Source Control' icon on the left side menu.

7. Select the file with conflicts.

8. Resolve conflicts by selecting one of the options below, and repeat this step for all merge conflicts in the file. Then, follow the same process for any other files with conflicts.

9. Click on 'Stage Changes/+' icon once all the merge conflicts are resolved.

10. Enter your commit message.

11. Click on 'Commit'.

That's it!

You have successfully resolved merge conflicts.

Conclusion

Resolving merge conflicts is a skill every developer needs, especially when working on a shared project where changes happen frequently.

Once you get comfortable with resolving conflicts, you’ll see that it’s not that scary—it’s all about keeping the code consistent and everyone’s hard work intact.

Still have questions?

Send an email to archana@leadwalnut.com, OR

Book a FREE consultation with an expert developer here.